evolution-data-server r8429 - trunk/camel



Author: sragavan
Date: Mon Jan 28 03:54:43 2008
New Revision: 8429
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=8429&view=rev

Log:
2008-01-11  Milan Crha  <mcrha redhat com>

	** Fix for bug #324168

	* camel-vee-summary.c: (vee_message_info_free),
	(vee_message_info_clone) (camel_vee_summary_add): Ensure the owner 
	of the real message info will not be freed before we unref the 
	message info itself.



Modified:
   trunk/camel/ChangeLog
   trunk/camel/camel-vee-summary.c

Modified: trunk/camel/camel-vee-summary.c
==============================================================================
--- trunk/camel/camel-vee-summary.c	(original)
+++ trunk/camel/camel-vee-summary.c	Mon Jan 28 03:54:43 2008
@@ -40,9 +40,15 @@
 vee_message_info_free(CamelFolderSummary *s, CamelMessageInfo *info)
 {
 	CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *)info;
+	CamelFolderSummary *real_summary = mi->real->summary;
 
 	g_free(info->uid);
 	camel_message_info_free(mi->real);
+
+	/* and unref the real summary too */
+	/* FIXME: You may not need this during CamelDBSummary */
+	if (real_summary)
+		camel_object_unref (real_summary);
 }
 
 static CamelMessageInfo *
@@ -54,8 +60,10 @@
 	to = (CamelVeeMessageInfo *)camel_message_info_new(s);
 
 	to->real = camel_message_info_clone(from->real);
+	/* FIXME: We may not need this during CamelDBSummary */
+	camel_object_ref (to->real->summary);
 	to->info.summary = s;
-
+	
 	return (CamelMessageInfo *)to;
 }
 
@@ -218,6 +226,13 @@
 	mi = (CamelVeeMessageInfo *)camel_message_info_new(&s->summary);
 	mi->real = info;
 	camel_message_info_ref(info);
+
+	/* Ensures the owner of the message info will not die before we free the mi->real;
+	   It's obvious that the real->summary should not be changed after this call. */
+	/* FIXME: We may not need this during CamelDBSummary */
+	if (info->summary)
+		camel_object_ref (info->summary);
+
 	mi->info.uid = vuid;
 
 	camel_folder_summary_add(&s->summary, (CamelMessageInfo *)mi);



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