[evolution-patches] 72337 crash enable/disable account w/ password active





? mail/ems.diff
? mail/evolution-mail-2.0.schemas
? mail/m.diff
? mail/ma.diff
? mail/default/zh_CN/Makefile
? mail/default/zh_CN/Makefile.in
Index: mail/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3576
diff -u -p -r1.3576 ChangeLog
--- mail/ChangeLog	18 Feb 2005 16:43:55 -0000	1.3576
+++ mail/ChangeLog	21 Feb 2005 05:47:17 -0000
@@ -1,3 +1,13 @@
+2005-02-21  Not Zed  <NotZed Ximian com>
+
+	** See bug #72337
+
+	* mail-component.c (store_info_new, store_info_unref): refcount
+	the storeinfo's.
+	(mc_add_store_done): noop if removed.
+	(store_hash_free, mail_component_remove_store): mark storeinfo
+	removed.
+
 2005-02-18  Rodney Dawes  <dobey novell com>
 
 	* mail/em-folder-view.c (emfv_popup_copy_text): New method to copy
Index: mail/mail-component.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-component.c,v
retrieving revision 1.106
diff -u -p -r1.106 mail-component.c
--- mail/mail-component.c	1 Feb 2005 08:35:03 -0000	1.106
+++ mail/mail-component.c	21 Feb 2005 05:47:19 -0000
@@ -102,6 +102,9 @@ struct _store_info {	
 	/* for setup only */
 	void (*done)(CamelStore *store, CamelFolderInfo *info, void *data);
 	void *done_data;
+
+	int ref_count:31;
+	int removed:1;
 };
 
 struct _MailComponentPrivate {
@@ -148,6 +151,7 @@ store_info_new(CamelStore *store, const 
 	struct _store_info *si;
 
 	si = g_malloc0(sizeof(*si));
+	si->ref_count = 1;
 	if (name == NULL)
 		si->name = camel_service_get_name((CamelService *)store, TRUE);
 	else
@@ -165,8 +169,19 @@ store_info_new(CamelStore *store, const 
 }
 
 static void
-store_info_free(struct _store_info *si)
+store_info_ref(struct _store_info *si)
+{
+	si->ref_count++;
+}
+
+static void
+store_info_unref(struct _store_info *si)
 {
+	if (si->ref_count > 1) {
+		si->ref_count--;
+		return;
+	}
+
 	if (si->vtrash)
 		camel_object_unref(si->vtrash);
 	if (si->vjunk)
@@ -184,11 +199,15 @@ mc_add_store_done(CamelStore *store, Cam
 	if (si->done)
 		si->done(store, info, si);
 
-	/* let the counters know about the already opened junk/trash folders */
-	if (si->vtrash)
-		mail_note_folder(si->vtrash);
-	if (si->vjunk)
-		mail_note_folder(si->vjunk);
+	if (!si->removed) {
+		/* let the counters know about the already opened junk/trash folders */
+		if (si->vtrash)
+			mail_note_folder(si->vtrash);
+		if (si->vjunk)
+			mail_note_folder(si->vjunk);
+	}
+
+	store_info_unref(si);
 }
 
 /* Utility functions.  */
@@ -203,6 +222,7 @@ mc_add_store(MailComponent *component, C
 	si->done = done;
 	g_hash_table_insert(component->priv->store_hash, store, si);
 	em_folder_tree_model_add_store(component->priv->model, store, si->name);
+	store_info_ref(si);
 	mail_note_store(store, NULL, mc_add_store_done, si);
 }
 
@@ -429,7 +449,8 @@ impl_dispose (GObject *object)
 static void
 store_hash_free (CamelStore *store, struct _store_info *si, void *data)
 {
-	store_info_free(si);
+	si->removed = 1;
+	store_info_unref(si);
 }
 
 static void
@@ -1029,7 +1050,8 @@ mail_component_remove_store (MailCompone
 		return;
 	
 	g_hash_table_remove (priv->store_hash, store);
-	store_info_free(si);
+	si->removed = 1;
+	store_info_unref(si);
 	
 	/* so i guess potentially we could have a race, add a store while one
 	   being removed.  ?? */


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