diff options
Diffstat (limited to 'addressbook/backend/pas/pas-backend-ldap.c')
-rw-r--r-- | addressbook/backend/pas/pas-backend-ldap.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/addressbook/backend/pas/pas-backend-ldap.c b/addressbook/backend/pas/pas-backend-ldap.c index cf464ba4e6..010e8d104e 100644 --- a/addressbook/backend/pas/pas-backend-ldap.c +++ b/addressbook/backend/pas/pas-backend-ldap.c @@ -3436,22 +3436,28 @@ pas_backend_ldap_dispose (GObject *object) bl = PAS_BACKEND_LDAP (object); - g_hash_table_foreach_remove (bl->priv->id_to_op, (GHRFunc)call_dtor, NULL); - g_hash_table_destroy (bl->priv->id_to_op); + if (bl->priv) { + g_hash_table_foreach_remove (bl->priv->id_to_op, (GHRFunc)call_dtor, NULL); + g_hash_table_destroy (bl->priv->id_to_op); - if (bl->priv->poll_timeout != -1) { - printf ("removing timeout\n"); - g_source_remove (bl->priv->poll_timeout); - } + if (bl->priv->poll_timeout != -1) { + printf ("removing timeout\n"); + g_source_remove (bl->priv->poll_timeout); + } - g_object_unref (bl->priv->book_views); + g_object_unref (bl->priv->book_views); - if (bl->priv->supported_fields) - g_object_unref (bl->priv->supported_fields); + if (bl->priv->supported_fields) + g_object_unref (bl->priv->supported_fields); - g_free (bl->priv->uri); + g_free (bl->priv->uri); + + g_free (bl->priv); + bl->priv = NULL; + } - G_OBJECT_CLASS (pas_backend_ldap_parent_class)->dispose (object); + if (G_OBJECT_CLASS (pas_backend_ldap_parent_class)->dispose) + G_OBJECT_CLASS (pas_backend_ldap_parent_class)->dispose (object); } static void |