evolution-data-server r8908 - branches/camel-db-summary/camel



Author: psankar
Date: Wed Jun  4 07:07:35 2008
New Revision: 8908
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=8908&view=rev

Log:
Free message-info-records and the strings that it has. 


Modified:
   branches/camel-db-summary/camel/camel-db.c
   branches/camel-db-summary/camel/camel-db.h
   branches/camel-db-summary/camel/camel-folder-summary.c

Modified: branches/camel-db-summary/camel/camel-db.c
==============================================================================
--- branches/camel-db-summary/camel/camel-db.c	(original)
+++ branches/camel-db-summary/camel/camel-db.c	Wed Jun  4 07:07:35 2008
@@ -469,6 +469,8 @@
 
 	query = sqlite3_mprintf ("SELECT * FROM %Q ", folder_name);
 	ret = camel_db_select (cdb, query, read_mir_callback, p, ex);
+	sqlite3_free (query);
+
 	return (ret);
 }
 
@@ -483,3 +485,27 @@
 
 	return ret;
 }
+
+
+void
+camel_db_camel_mir_free (CamelMIRecord *record)
+{
+	if (record) {
+		g_free (record->uid);
+		g_free (record->subject);
+		g_free (record->from);
+		g_free (record->to);
+		g_free (record->cc);
+		g_free (record->mlist);
+		g_free (record->followup_flag);
+		g_free (record->followup_completed_on);
+		g_free (record->followup_due_by);
+		g_free (record->part);
+		g_free (record->labels);
+		g_free (record->usertags);
+		g_free (record->cinfo);
+		g_free (record->bdata);
+
+		g_free (record);
+	}
+}

Modified: branches/camel-db-summary/camel/camel-db.h
==============================================================================
--- branches/camel-db-summary/camel/camel-db.h	(original)
+++ branches/camel-db-summary/camel/camel-db.h	Wed Jun  4 07:07:35 2008
@@ -121,5 +121,7 @@
 int camel_db_count_deleted_message_info (CamelDB *cdb, const char *table_name, guint32 *count, CamelException *ex);
 int camel_db_count_total_message_info (CamelDB *cdb, const char *table_name, guint32 *count, CamelException *ex);
 
+void camel_db_camel_mir_free (CamelMIRecord *record);
+
 #endif
 

Modified: branches/camel-db-summary/camel/camel-folder-summary.c
==============================================================================
--- branches/camel-db-summary/camel/camel-folder-summary.c	(original)
+++ branches/camel-db-summary/camel/camel-folder-summary.c	Wed Jun  4 07:07:35 2008
@@ -709,7 +709,7 @@
 	} else
 		g_warning ("Loading messageinfo from db failed");
 
-	g_free (mir);
+	camel_db_camel_mir_free (mir);
 
 	return 0;
 }
@@ -853,18 +853,18 @@
 		if (mir && s->build_content) {
 			if (perform_content_info_save_to_db (s, ((CamelMessageInfoBase *)mi)->content, mir) == -1) {
 				g_warning ("unable to save mir+cinfo for uid: %s\n", mir->uid);
-				g_free (mir);
+				camel_db_camel_mir_free (mir);
 				/* FIXME: Add exception here */
 				return -1;
 			}
 		}
 
 		if (camel_db_write_message_info_record (cdb, folder_name, mir, ex) != 0) {
-			g_free (mir);
+			camel_db_camel_mir_free (mir);
 			return -1;
 		}
 
-		g_free (mir);
+		camel_db_camel_mir_free (mir);
 	}	
 	return 0;
 }



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