[evolution-data-server] Bug 725295 - Crash in e_cal_backend_remove_view()
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Bug 725295 - Crash in e_cal_backend_remove_view()
- Date: Tue, 13 Mar 2018 17:14:20 +0000 (UTC)
commit cd9ec8ea22010fdbd0726f8648a78c4affd3037a
Author: Milan Crha <mcrha redhat com>
Date: Tue Mar 13 18:15:29 2018 +0100
Bug 725295 - Crash in e_cal_backend_remove_view()
src/addressbook/libedata-book/e-book-backend.c | 5 +++++
src/calendar/libedata-cal/e-cal-backend.c | 5 +++++
src/libebackend/e-backend.c | 4 ++++
3 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/addressbook/libedata-book/e-book-backend.c b/src/addressbook/libedata-book/e-book-backend.c
index af845d8..5ab1e91 100644
--- a/src/addressbook/libedata-book/e-book-backend.c
+++ b/src/addressbook/libedata-book/e-book-backend.c
@@ -3140,6 +3140,9 @@ e_book_backend_remove_view (EBookBackend *backend,
g_return_if_fail (E_IS_BOOK_BACKEND (backend));
+ /* In case the view holds the last reference to backend */
+ g_object_ref (backend);
+
g_mutex_lock (&backend->priv->views_mutex);
list = backend->priv->views;
@@ -3153,6 +3156,8 @@ e_book_backend_remove_view (EBookBackend *backend,
backend->priv->views = list;
g_mutex_unlock (&backend->priv->views_mutex);
+
+ g_object_unref (backend);
}
/**
diff --git a/src/calendar/libedata-cal/e-cal-backend.c b/src/calendar/libedata-cal/e-cal-backend.c
index 603567a..3756665 100644
--- a/src/calendar/libedata-cal/e-cal-backend.c
+++ b/src/calendar/libedata-cal/e-cal-backend.c
@@ -1473,6 +1473,9 @@ e_cal_backend_remove_view (ECalBackend *backend,
g_return_if_fail (backend != NULL);
g_return_if_fail (E_IS_CAL_BACKEND (backend));
+ /* In case the view holds the last reference to backend */
+ g_object_ref (backend);
+
g_mutex_lock (&backend->priv->views_mutex);
list = backend->priv->views;
@@ -1486,6 +1489,8 @@ e_cal_backend_remove_view (ECalBackend *backend,
backend->priv->views = list;
g_mutex_unlock (&backend->priv->views_mutex);
+
+ g_object_unref (backend);
}
/**
diff --git a/src/libebackend/e-backend.c b/src/libebackend/e-backend.c
index 3c92f47..ebbea1a 100644
--- a/src/libebackend/e-backend.c
+++ b/src/libebackend/e-backend.c
@@ -1536,5 +1536,9 @@ e_backend_prepare_shutdown (EBackend *backend)
class = E_BACKEND_GET_CLASS (backend);
g_return_if_fail (class->prepare_shutdown != NULL);
+ g_object_ref (backend);
+
class->prepare_shutdown (backend);
+
+ g_object_unref (backend);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]