[evolution-mapi] Bug #609967 - Crash in camel_mapi_notification_listener_stop



commit 54134ced21ef86ff4d21ada1cefb4a2382292edc
Author: Milan Crha <mcrha redhat com>
Date:   Mon Feb 15 14:30:55 2010 +0100

    Bug #609967 - Crash in camel_mapi_notification_listener_stop

 src/camel/camel-mapi-notifications.c |    8 ++++++++
 src/camel/camel-mapi-store.c         |    9 +++++++++
 src/camel/camel-mapi-store.h         |    2 ++
 3 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/src/camel/camel-mapi-notifications.c b/src/camel/camel-mapi-notifications.c
index 3276a8e..a847fb8 100644
--- a/src/camel/camel-mapi-notifications.c
+++ b/src/camel/camel-mapi-notifications.c
@@ -245,6 +245,14 @@ mapi_push_notification_listener (CamelSession *session, CamelSessionThreadMsg *m
 static void
 mapi_push_notification_listener_close (CamelSession *session, CamelSessionThreadMsg *msg)
 {
+	struct mapi_push_notification_msg *m = (struct mapi_push_notification_msg *)msg;
+	CamelMapiStore *mstore = (CamelMapiStore *) m->event_data;
+
+	camel_object_ref (mstore);
+	CAMEL_SERVICE_REC_LOCK (mstore, connect_lock);
+	camel_mapi_store_unset_notification_data (mstore);
+	CAMEL_SERVICE_REC_UNLOCK (mstore, connect_lock);
+	camel_object_unref (mstore);
 }
 
 gpointer
diff --git a/src/camel/camel-mapi-store.c b/src/camel/camel-mapi-store.c
index 1c3c157..ee6a3ee 100644
--- a/src/camel/camel-mapi-store.c
+++ b/src/camel/camel-mapi-store.c
@@ -434,6 +434,15 @@ mapi_connect(CamelService *service, CamelException *ex)
 	return TRUE;
 }
 
+void
+camel_mapi_store_unset_notification_data (CamelMapiStore *mstore)
+{
+	g_return_if_fail (mstore != NULL);
+	g_return_if_fail (CAMEL_IS_MAPI_STORE (mstore));
+
+	mstore->priv->notification_data = NULL;
+}
+
 static gboolean 
 mapi_disconnect(CamelService *service, gboolean clean, CamelException *ex)
 {
diff --git a/src/camel/camel-mapi-store.h b/src/camel/camel-mapi-store.h
index 329e560..c464703 100644
--- a/src/camel/camel-mapi-store.h
+++ b/src/camel/camel-mapi-store.h
@@ -98,6 +98,8 @@ const gchar *camel_mapi_store_system_folder_fid (CamelMapiStore *mapi_store, gui
 const gchar *camel_mapi_store_folder_id_lookup_offline (CamelMapiStore *mapi_store, const char *folder_name);
 const gchar* mapi_folders_hash_table_name_lookup (CamelMapiStore *store, const gchar *fid, gboolean use_cache);
 
+void camel_mapi_store_unset_notification_data (CamelMapiStore *mstore);
+
 __END_DECLS
 
 #endif /* __CAMEL_OPENCHANGE_STORE_H__ */



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