empathy r2069 - trunk/libempathy
- From: xclaesse svn gnome org
- To: svn-commits-list gnome org
- Subject: empathy r2069 - trunk/libempathy
- Date: Tue, 6 Jan 2009 16:48:19 +0000 (UTC)
Author: xclaesse
Date: Tue Jan 6 16:48:19 2009
New Revision: 2069
URL: http://svn.gnome.org/viewvc/empathy?rev=2069&view=rev
Log:
Drop our references in dispose instead of finalize.
Modified:
trunk/libempathy/empathy-contact-monitor.c
Modified: trunk/libempathy/empathy-contact-monitor.c
==============================================================================
--- trunk/libempathy/empathy-contact-monitor.c (original)
+++ trunk/libempathy/empathy-contact-monitor.c Tue Jan 6 16:48:19 2009
@@ -35,6 +35,8 @@
typedef struct {
EmpathyContactList *proxy;
GPtrArray *contacts;
+
+ gboolean dispose_run;
} EmpathyContactMonitorPriv;
enum {
@@ -111,8 +113,6 @@
priv = GET_PRIV (obj);
if (priv->contacts) {
- g_ptr_array_foreach (priv->contacts,
- (GFunc) contact_remove_foreach, obj);
g_ptr_array_free (priv->contacts, TRUE);
priv->contacts = NULL;
}
@@ -126,11 +126,38 @@
}
static void
+do_dispose (GObject *obj)
+{
+ EmpathyContactMonitorPriv *priv;
+
+ priv = GET_PRIV (obj);
+
+ if (priv->dispose_run) {
+ return;
+ }
+
+ if (priv->contacts) {
+ g_ptr_array_foreach (priv->contacts,
+ (GFunc) contact_remove_foreach, obj);
+ }
+
+ if (priv->proxy) {
+ g_signal_handlers_disconnect_by_func (priv->proxy,
+ cl_members_changed_cb, obj);
+ }
+
+ priv->dispose_run = TRUE;
+
+ G_OBJECT_CLASS (empathy_contact_monitor_parent_class)->dispose (obj);
+}
+
+static void
empathy_contact_monitor_class_init (EmpathyContactMonitorClass *klass)
{
GObjectClass *oclass = G_OBJECT_CLASS (klass);
oclass->finalize = do_finalize;
+ oclass->dispose = do_dispose;
oclass->get_property = do_get_property;
oclass->set_property = do_set_property;
@@ -225,6 +252,7 @@
self->priv = priv;
priv->contacts = NULL;
priv->proxy = NULL;
+ priv->dispose_run = FALSE;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]