Bug #686727 - POP3 provider deadlocks on finalize
authorMilan Crha <mcrha@redhat.com>
Wed, 24 Oct 2012 16:37:12 +0000 (18:37 +0200)
committerMilan Crha <mcrha@redhat.com>
Wed, 24 Oct 2012 16:37:12 +0000 (18:37 +0200)
camel/providers/pop3/camel-pop3-store.c

index e934e7a..f721668 100644 (file)
@@ -330,7 +330,7 @@ exit:
 }
 
 static void
-pop3_store_finalize (GObject *object)
+pop3_store_dispose (GObject *object)
 {
        CamelPOP3Store *pop3_store = CAMEL_POP3_STORE (object);
 
@@ -339,6 +339,15 @@ pop3_store_finalize (GObject *object)
        camel_service_disconnect_sync (
                CAMEL_SERVICE (pop3_store), TRUE, NULL, NULL);
 
+       /* Chain up to parent's dispose() method. */
+       G_OBJECT_CLASS (camel_pop3_store_parent_class)->dispose (object);
+}
+
+static void
+pop3_store_finalize (GObject *object)
+{
+       CamelPOP3Store *pop3_store = CAMEL_POP3_STORE (object);
+
        if (pop3_store->engine)
                g_object_unref (pop3_store->engine);
        if (pop3_store->cache)
@@ -775,6 +784,7 @@ camel_pop3_store_class_init (CamelPOP3StoreClass *class)
        CamelStoreClass *store_class;
 
        object_class = G_OBJECT_CLASS (class);
+       object_class->dispose = pop3_store_dispose;
        object_class->finalize = pop3_store_finalize;
 
        service_class = CAMEL_SERVICE_CLASS (class);