[evolution-ews/gnome-3-34] Disconnect signal handlers on connection object in dispose of book/calendar backend
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-ews/gnome-3-34] Disconnect signal handlers on connection object in dispose of book/calendar backend
- Date: Thu, 31 Oct 2019 10:32:03 +0000 (UTC)
commit b63ce5bb8f0afdbbaa210bbd59c71ebaff6ca81f
Author: Milan Crha <mcrha redhat com>
Date: Thu Oct 31 11:30:32 2019 +0100
Disconnect signal handlers on connection object in dispose of book/calendar backend
The signal handlers could be called after the backend was freed,
causing a crash of the respective factory. That's because the connection
object can be shared between backends, thus it can live longer than
the backends.
src/addressbook/e-book-backend-ews.c | 6 +-----
src/calendar/e-cal-backend-ews.c | 6 +-----
2 files changed, 2 insertions(+), 10 deletions(-)
---
diff --git a/src/addressbook/e-book-backend-ews.c b/src/addressbook/e-book-backend-ews.c
index 34de8ffa..e8412d3d 100644
--- a/src/addressbook/e-book-backend-ews.c
+++ b/src/addressbook/e-book-backend-ews.c
@@ -4035,11 +4035,7 @@ e_book_backend_ews_dispose (GObject *object)
{
EBookBackendEws *bbews = E_BOOK_BACKEND_EWS (object);
- g_rec_mutex_lock (&bbews->priv->cnc_lock);
-
- g_clear_object (&bbews->priv->cnc);
-
- g_rec_mutex_unlock (&bbews->priv->cnc_lock);
+ ebb_ews_unset_connection (bbews);
/* Chain up to parent's method. */
G_OBJECT_CLASS (e_book_backend_ews_parent_class)->dispose (object);
diff --git a/src/calendar/e-cal-backend-ews.c b/src/calendar/e-cal-backend-ews.c
index 354d8aee..a6070f51 100644
--- a/src/calendar/e-cal-backend-ews.c
+++ b/src/calendar/e-cal-backend-ews.c
@@ -4218,11 +4218,7 @@ ecb_ews_dispose (GObject *object)
{
ECalBackendEws *cbews = E_CAL_BACKEND_EWS (object);
- g_rec_mutex_lock (&cbews->priv->cnc_lock);
-
- g_clear_object (&cbews->priv->cnc);
-
- g_rec_mutex_unlock (&cbews->priv->cnc_lock);
+ ecb_ews_unset_connection (cbews);
/* Chain up to parent's method. */
G_OBJECT_CLASS (e_cal_backend_ews_parent_class)->dispose (object);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]