aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-06-11 04:37:03 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-06-11 04:43:38 +0800
commit54384b72172d92bb69d136b564a6096978f50695 (patch)
treef4a7bbb042ca773843cb833f06ae055783a8e202 /modules/calendar
parent243f84d37d2391ef58680ef2341ed35139104642 (diff)
downloadgsoc2013-evolution-54384b72172d92bb69d136b564a6096978f50695.tar
gsoc2013-evolution-54384b72172d92bb69d136b564a6096978f50695.tar.gz
gsoc2013-evolution-54384b72172d92bb69d136b564a6096978f50695.tar.bz2
gsoc2013-evolution-54384b72172d92bb69d136b564a6096978f50695.tar.lz
gsoc2013-evolution-54384b72172d92bb69d136b564a6096978f50695.tar.xz
gsoc2013-evolution-54384b72172d92bb69d136b564a6096978f50695.tar.zst
gsoc2013-evolution-54384b72172d92bb69d136b564a6096978f50695.zip
ECalShellView: Disconnect "prepare-for-quit" handler on dispose().
This is another source of crashes after creating and destroying a second shell window. The signal handler was left connected with the destroyed shell window as the closure.
Diffstat (limited to 'modules/calendar')
-rw-r--r--modules/calendar/e-cal-shell-view-private.c8
-rw-r--r--modules/calendar/e-cal-shell-view-private.h3
-rw-r--r--modules/calendar/e-cal-shell-view.c6
3 files changed, 16 insertions, 1 deletions
diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c
index 99de61c4ee..8f5ce93792 100644
--- a/modules/calendar/e-cal-shell-view-private.c
+++ b/modules/calendar/e-cal-shell-view-private.c
@@ -734,6 +734,13 @@ e_cal_shell_view_private_dispose (ECalShellView *cal_shell_view)
if (priv->cal_shell_content != NULL)
e_cal_shell_content_save_state (priv->cal_shell_content);
+ if (priv->prepare_for_quit_handler_id > 0) {
+ g_signal_handler_disconnect (
+ priv->shell,
+ priv->prepare_for_quit_handler_id);
+ priv->prepare_for_quit_handler_id = 0;
+ }
+
if (priv->backend_error_handler_id > 0) {
g_signal_handler_disconnect (
priv->client_cache,
@@ -745,6 +752,7 @@ e_cal_shell_view_private_dispose (ECalShellView *cal_shell_view)
g_clear_object (&priv->cal_shell_content);
g_clear_object (&priv->cal_shell_sidebar);
+ g_clear_object (&priv->shell);
g_clear_object (&priv->client_cache);
if (priv->calendar_activity != NULL) {
diff --git a/modules/calendar/e-cal-shell-view-private.h b/modules/calendar/e-cal-shell-view-private.h
index 7931eb3a3d..30962d841b 100644
--- a/modules/calendar/e-cal-shell-view-private.h
+++ b/modules/calendar/e-cal-shell-view-private.h
@@ -93,6 +93,9 @@ struct _ECalShellViewPrivate {
ECalShellContent *cal_shell_content;
ECalShellSidebar *cal_shell_sidebar;
+ EShell *shell;
+ gulong prepare_for_quit_handler_id;
+
EClientCache *client_cache;
gulong backend_error_handler_id;
diff --git a/modules/calendar/e-cal-shell-view.c b/modules/calendar/e-cal-shell-view.c
index a6e347528d..39f1472dbb 100644
--- a/modules/calendar/e-cal-shell-view.c
+++ b/modules/calendar/e-cal-shell-view.c
@@ -101,6 +101,7 @@ cal_shell_view_constructed (GObject *object)
ECalShellContent *cal_shell_content;
GtkWidget *container;
GtkWidget *widget;
+ gulong handler_id;
/* Chain up to parent's constructed() method. */
G_OBJECT_CLASS (parent_class)->constructed (object);
@@ -126,10 +127,13 @@ cal_shell_view_constructed (GObject *object)
gtk_container_add (GTK_CONTAINER (container), widget);
gtk_widget_show (widget);
- g_signal_connect (
+ handler_id = g_signal_connect (
shell, "prepare-for-quit",
G_CALLBACK (cal_shell_view_prepare_for_quit_cb),
cal_shell_view);
+
+ cal_shell_view->priv->shell = g_object_ref (shell);
+ cal_shell_view->priv->prepare_for_quit_handler_id = handler_id;
}
static void