[evolution-data-server/gnome-3-22] Test for parent_store availability around camel_folder_changed()
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-3-22] Test for parent_store availability around camel_folder_changed()
- Date: Wed, 7 Dec 2016 21:04:05 +0000 (UTC)
commit 01a1732801a0b2cb01f49f1c1787065915d4ca7e
Author: Milan Crha <mcrha redhat com>
Date: Wed Dec 7 21:59:36 2016 +0100
Test for parent_store availability around camel_folder_changed()
This could happen after the changes for the bug 772292.
camel/camel-folder.c | 32 ++++++++++++++++++--------------
1 files changed, 18 insertions(+), 14 deletions(-)
---
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index 0d825d4..bf2f2bf 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -1091,6 +1091,9 @@ folder_changed (CamelFolder *folder,
g_mutex_unlock (&folder->priv->change_lock);
parent_store = camel_folder_get_parent_store (folder);
+ if (!parent_store)
+ return;
+
session = camel_service_ref_session (CAMEL_SERVICE (parent_store));
if (!session)
return;
@@ -2401,24 +2404,25 @@ camel_folder_changed (CamelFolder *folder,
SignalClosure *signal_closure;
parent_store = camel_folder_get_parent_store (folder);
+ if (parent_store) {
+ service = CAMEL_SERVICE (parent_store);
+ session = camel_service_ref_session (service);
- service = CAMEL_SERVICE (parent_store);
- session = camel_service_ref_session (service);
+ if (session) {
+ pending_changes = camel_folder_change_info_new ();
+ folder->priv->pending_changes = pending_changes;
- if (session) {
- pending_changes = camel_folder_change_info_new ();
- folder->priv->pending_changes = pending_changes;
+ signal_closure = g_slice_new0 (SignalClosure);
+ signal_closure->folder = g_object_ref (folder);
- signal_closure = g_slice_new0 (SignalClosure);
- signal_closure->folder = g_object_ref (folder);
+ camel_session_idle_add (
+ session, G_PRIORITY_LOW,
+ folder_emit_changed_cb,
+ signal_closure,
+ (GDestroyNotify) signal_closure_free);
- camel_session_idle_add (
- session, G_PRIORITY_LOW,
- folder_emit_changed_cb,
- signal_closure,
- (GDestroyNotify) signal_closure_free);
-
- g_object_unref (session);
+ g_object_unref (session);
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]