From 1f8eabe94fa7ac101606bb441d267db1fbac09c6 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 15 Sep 2011 14:54:31 +0200 Subject: Bug #659125 - Reference counting issues in calendar --- modules/calendar/e-cal-shell-view-memopad.c | 1 - modules/calendar/e-cal-shell-view-taskpad.c | 3 +-- modules/calendar/e-memo-shell-backend.c | 3 +++ modules/calendar/e-memo-shell-view-actions.c | 1 - modules/calendar/e-task-shell-backend.c | 3 +++ modules/calendar/e-task-shell-view-actions.c | 1 - modules/calendar/e-task-shell-view-private.c | 2 +- 7 files changed, 8 insertions(+), 6 deletions(-) (limited to 'modules/calendar') diff --git a/modules/calendar/e-cal-shell-view-memopad.c b/modules/calendar/e-cal-shell-view-memopad.c index bd1e9d5ac8..4978ca2183 100644 --- a/modules/calendar/e-cal-shell-view-memopad.c +++ b/modules/calendar/e-cal-shell-view-memopad.c @@ -92,7 +92,6 @@ action_calendar_memopad_new_cb (GtkAction *action, gtk_window_present (GTK_WINDOW (editor)); g_object_unref (comp); - g_object_unref (client); } static void diff --git a/modules/calendar/e-cal-shell-view-taskpad.c b/modules/calendar/e-cal-shell-view-taskpad.c index 48c81ac085..92263c75e3 100644 --- a/modules/calendar/e-cal-shell-view-taskpad.c +++ b/modules/calendar/e-cal-shell-view-taskpad.c @@ -160,7 +160,6 @@ action_calendar_taskpad_new_cb (GtkAction *action, gtk_window_present (GTK_WINDOW (editor)); g_object_unref (comp); - g_object_unref (client); } static void @@ -548,7 +547,7 @@ e_cal_shell_view_taskpad_open_task (ECalShellView *cal_shell_view, editor = task_editor_new (comp_data->client, shell, flags); comp_editor_edit_comp (editor, comp); - g_object_ref (comp); + g_object_unref (comp); if (flags & COMP_EDITOR_IS_ASSIGNED) task_editor_show_assignment (TASK_EDITOR (editor)); diff --git a/modules/calendar/e-memo-shell-backend.c b/modules/calendar/e-memo-shell-backend.c index 6f8070094e..7edb82d6bb 100644 --- a/modules/calendar/e-memo-shell-backend.c +++ b/modules/calendar/e-memo-shell-backend.c @@ -422,6 +422,8 @@ memo_shell_backend_handle_uri_cb (EShellBackend *shell_backend, g_warning ( "%s: Failed to create/open client: %s", G_STRFUNC, error->message); + if (client != NULL) + g_object_unref (client); g_object_unref (source_list); g_error_free (error); goto exit; @@ -443,6 +445,7 @@ memo_shell_backend_handle_uri_cb (EShellBackend *shell_backend, "%s: Failed to get object: %s", G_STRFUNC, error->message); g_object_unref (source_list); + g_object_unref (client); g_error_free (error); goto exit; } diff --git a/modules/calendar/e-memo-shell-view-actions.c b/modules/calendar/e-memo-shell-view-actions.c index eacb5c1da7..d71b893fe3 100644 --- a/modules/calendar/e-memo-shell-view-actions.c +++ b/modules/calendar/e-memo-shell-view-actions.c @@ -385,7 +385,6 @@ action_memo_new_cb (GtkAction *action, gtk_window_present (GTK_WINDOW (editor)); g_object_unref (comp); - g_object_unref (client); } static void diff --git a/modules/calendar/e-task-shell-backend.c b/modules/calendar/e-task-shell-backend.c index bb296fd5c2..f6a5e14588 100644 --- a/modules/calendar/e-task-shell-backend.c +++ b/modules/calendar/e-task-shell-backend.c @@ -422,6 +422,8 @@ task_shell_backend_handle_uri_cb (EShellBackend *shell_backend, g_warning ( "%s: Failed to create/open client: %s", G_STRFUNC, error->message); + if (client) + g_object_unref (client); g_object_unref (source_list); g_error_free (error); goto exit; @@ -443,6 +445,7 @@ task_shell_backend_handle_uri_cb (EShellBackend *shell_backend, "%s: Failed to get object: %s", G_STRFUNC, error->message); g_object_unref (source_list); + g_object_unref (client); g_error_free (error); goto exit; } diff --git a/modules/calendar/e-task-shell-view-actions.c b/modules/calendar/e-task-shell-view-actions.c index 1fb4867205..2fe28494ac 100644 --- a/modules/calendar/e-task-shell-view-actions.c +++ b/modules/calendar/e-task-shell-view-actions.c @@ -453,7 +453,6 @@ action_task_new_cb (GtkAction *action, gtk_window_present (GTK_WINDOW (editor)); g_object_unref (comp); - g_object_unref (client); } static void diff --git a/modules/calendar/e-task-shell-view-private.c b/modules/calendar/e-task-shell-view-private.c index b8122786f2..8c02ceccbc 100644 --- a/modules/calendar/e-task-shell-view-private.c +++ b/modules/calendar/e-task-shell-view-private.c @@ -445,7 +445,7 @@ e_task_shell_view_open_task (ETaskShellView *task_shell_view, editor = task_editor_new (comp_data->client, shell, flags); comp_editor_edit_comp (editor, comp); - g_object_ref (comp); + g_object_unref (comp); if (flags & COMP_EDITOR_IS_ASSIGNED) task_editor_show_assignment (TASK_EDITOR (editor)); -- cgit v1.2.3