Bug 627616 - CamelIMAPXStoreSummary never frees its namespace list
authorMatthew Barnes <mbarnes@redhat.com>
Fri, 27 Aug 2010 16:13:30 +0000 (12:13 -0400)
committerMatthew Barnes <mbarnes@redhat.com>
Fri, 27 Aug 2010 16:14:35 +0000 (12:14 -0400)
camel/providers/imapx/camel-imapx-store-summary.c
camel/providers/imapx/camel-imapx-store-summary.h

index becb050..1b75be7 100644 (file)
@@ -53,10 +53,27 @@ static void store_info_set_string(CamelStoreSummary *, CamelStoreInfo *, int, co
 G_DEFINE_TYPE (CamelIMAPXStoreSummary, camel_imapx_store_summary, CAMEL_TYPE_STORE_SUMMARY)
 
 static void
+imapx_store_summary_finalize (GObject *object)
+{
+       CamelIMAPXStoreSummary *summary;
+
+       summary = CAMEL_IMAPX_STORE_SUMMARY (object);
+
+       camel_imapx_namespace_list_clear (summary->namespaces);
+
+       /* Chain up to parent's finalize() method. */
+       G_OBJECT_CLASS (camel_imapx_store_summary_parent_class)->finalize (object);
+}
+
+static void
 camel_imapx_store_summary_class_init (CamelIMAPXStoreSummaryClass *class)
 {
+       GObjectClass *object_class;
        CamelStoreSummaryClass *store_summary_class;
 
+       object_class = G_OBJECT_CLASS (class);
+       object_class->finalize = imapx_store_summary_finalize;
+
        store_summary_class = CAMEL_STORE_SUMMARY_CLASS (class);
        store_summary_class->summary_header_load = summary_header_load;
        store_summary_class->summary_header_save = summary_header_save;
index c290ee0..ed4b2ca 100644 (file)
        (camel_imapx_store_summary_get_type ())
 #define CAMEL_IMAPX_STORE_SUMMARY(obj) \
        (G_TYPE_CHECK_INSTANCE_CAST \
-       ((obj), CAMEL_TYPE_IMAPX_STORE_SUMMARY, CamelIMAPXStoreSummary)
+       ((obj), CAMEL_TYPE_IMAPX_STORE_SUMMARY, CamelIMAPXStoreSummary))
 #define CAMEL_IMAPX_STORE_SUMMARY_CLASS(cls) \
        (G_TYPE_CHECK_CLASS_CAST \
-       ((cls), CAMEL_TYPE_IMAPX_STORE_SUMMARY, CamelIMAPXStoreSummaryClass)
+       ((cls), CAMEL_TYPE_IMAPX_STORE_SUMMARY, CamelIMAPXStoreSummaryClass))
 #define CAMEL_IS_IMAPX_STORE_SUMMARY(obj) \
        (G_TYPE_CHECK_INSTANCE_TYPE \
        ((obj), CAMEL_TYPE_IMAPX_STORE_SUMMARY))