[evolution/gnome-3-8] Bug #703153 - Forgotten signal callbacks for freed objects



commit 6736cd2ed1463046a5097d7fa5477cd84454e94f
Author: Milan Crha <mcrha redhat com>
Date:   Fri Jul 19 17:44:16 2013 +0200

    Bug #703153 - Forgotten signal callbacks for freed objects

 calendar/gui/e-day-view.c              |    7 +++++++
 calendar/gui/e-week-view.c             |    5 +++++
 calendar/gui/gnome-cal.c               |    5 +----
 modules/calendar/e-cal-shell-sidebar.c |    3 +++
 4 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 9be015d..4e31f2c 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -744,9 +744,16 @@ static void
 day_view_dispose (GObject *object)
 {
        EDayView *day_view;
+       ECalModel *model;
        gint day;
 
        day_view = E_DAY_VIEW (object);
+       model = e_calendar_view_get_model (E_CALENDAR_VIEW (day_view));
+
+       if (model) {
+               g_signal_handlers_disconnect_by_data (model, day_view);
+               g_signal_handlers_disconnect_by_data (model, day_view->main_canvas);
+       }
 
        e_day_view_cancel_layout (day_view);
 
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 30d8aa5..0eb04f2 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -684,11 +684,16 @@ static void
 week_view_dispose (GObject *object)
 {
        EWeekView *week_view;
+       ECalModel *model;
 
        week_view = E_WEEK_VIEW (object);
+       model = e_calendar_view_get_model (E_CALENDAR_VIEW (object));
 
        e_week_view_cancel_layout (week_view);
 
+       if (model)
+               g_signal_handlers_disconnect_by_data (model, object);
+
        if (week_view->events) {
                e_week_view_free_events (week_view);
                g_array_free (week_view->events, TRUE);
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 442ee98..e9d0e18 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -1573,10 +1573,7 @@ gnome_calendar_do_dispose (GObject *object)
        }
 
        if (priv->model != NULL) {
-               g_signal_handlers_disconnect_by_func (
-                       priv->model, view_progress_cb, object);
-               g_signal_handlers_disconnect_by_func (
-                       priv->model, view_complete_cb, object);
+               g_signal_handlers_disconnect_by_data (priv->model, object);
                g_object_unref (priv->model);
                priv->model = NULL;
        }
diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c
index 3b4731e..1d0529c 100644
--- a/modules/calendar/e-cal-shell-sidebar.c
+++ b/modules/calendar/e-cal-shell-sidebar.c
@@ -385,6 +385,9 @@ cal_shell_sidebar_restore_state_cb (EShellWindow *shell_window,
        shell = e_shell_window_get_shell (shell_window);
        shell_settings = e_shell_get_shell_settings (shell);
 
+       g_signal_handlers_disconnect_by_func (shell_window,
+               cal_shell_sidebar_restore_state_cb, shell_sidebar);
+
        selector = E_SOURCE_SELECTOR (priv->selector);
        registry = e_source_selector_get_registry (selector);
        model = gtk_tree_view_get_model (GTK_TREE_VIEW (selector));


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