Fix for TnyCamelFolder's dispose



This patch sets priv->account to NULL in the dispose of TnyCamelFolder.
Otherwise we could unref too many references, because dispose could be
called many times.

Be
diff --git a/ChangeLog b/ChangeLog
index adf4747..a48f499 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-11-27  Sergio Villar Senin  <svillar igalia com>
+
+	* libtinymail-camel/tny-camel-folder.c: set priv->account to NULL in
+	dispose after unref'ing it.
+
 2008-11-24  Jose Dapena Paz  <jdapena igalia com>
 
 	* Added new TnyGtkFolderListStore, implementing a plain model (no tree)
diff --git a/libtinymail-camel/tny-camel-folder.c b/libtinymail-camel/tny-camel-folder.c
index 4c197ee..5852094 100644
--- a/libtinymail-camel/tny-camel-folder.c
+++ b/libtinymail-camel/tny-camel-folder.c
@@ -6312,8 +6312,10 @@ tny_camel_folder_dispose (GObject *object)
 	if (priv->account)
 		g_object_weak_unref (G_OBJECT (priv->account), notify_account_del, self);
 #else
-	if (priv->account)
+	if (priv->account) {
 		g_object_unref (priv->account);
+		priv->account = NULL;
+	}
 #endif
 
 	if (priv->parent)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]