aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile.am2
-rw-r--r--lib/ephy-object-helpers.c38
-rw-r--r--lib/ephy-object-helpers.h32
3 files changed, 72 insertions, 0 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 6254b9aa0..79f4fb016 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -19,6 +19,7 @@ NOINST_H_FILES = \
ephy-module.h \
ephy-node-filter.h \
ephy-node-common.h \
+ ephy-object-helpers.h \
ephy-prefs.h \
ephy-shlib-loader.h \
ephy-signal-accumulator.h \
@@ -54,6 +55,7 @@ libephymisc_la_SOURCES = \
ephy-node-filter.c \
ephy-node-common.h \
ephy-node-db.c \
+ ephy-object-helpers.c \
ephy-prefs.h \
ephy-shlib-loader.c \
ephy-signal-accumulator.c \
diff --git a/lib/ephy-object-helpers.c b/lib/ephy-object-helpers.c
new file mode 100644
index 000000000..6ef398c89
--- /dev/null
+++ b/lib/ephy-object-helpers.c
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2005 Christian Persch
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ */
+
+#include "config.h"
+
+#include "ephy-object-helpers.h"
+
+static gboolean
+idle_unref (gpointer object)
+{
+ g_object_unref (object);
+
+ /* don't run again */
+ return FALSE;
+}
+
+void
+ephy_object_idle_unref (gpointer object)
+{
+ g_idle_add ((GSourceFunc) idle_unref, object);
+}
diff --git a/lib/ephy-object-helpers.h b/lib/ephy-object-helpers.h
new file mode 100644
index 000000000..4624c390b
--- /dev/null
+++ b/lib/ephy-object-helpers.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2005 Christian Persch
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ */
+
+#ifndef EPHY_OBJECT_HELPERS_H
+#define EPHY_OBJECT_HELPERS_H
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+void ephy_object_idle_unref (gpointer object);
+
+G_END_DECLS
+
+#endif