[evolution-data-server] EBook/CalClient reference imbalance after commit 033215f for bug 721712
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] EBook/CalClient reference imbalance after commit 033215f for bug 721712
- Date: Thu, 3 Jul 2014 15:21:51 +0000 (UTC)
commit 5d4193528fd196492e5364fac1b56cc4fc3ad2f8
Author: Milan Crha <mcrha redhat com>
Date: Thu Jul 3 17:18:58 2014 +0200
EBook/CalClient reference imbalance after commit 033215f for bug 721712
The g_async_result_get_source_object() returns a new reference
to the object, which I overlooked in my fix for bug 721712, thus
caused the reference imbalance. Fidencio spot it and let me know.
addressbook/libebook/e-book-client.c | 7 ++++++-
calendar/libecal/e-cal-client.c | 7 ++++++-
2 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/addressbook/libebook/e-book-client.c b/addressbook/libebook/e-book-client.c
index 168a764..a39e262 100644
--- a/addressbook/libebook/e-book-client.c
+++ b/addressbook/libebook/e-book-client.c
@@ -1314,6 +1314,7 @@ book_client_connect_open_cb (GObject *source_object,
{
GSimpleAsyncResult *simple;
gchar **properties = NULL;
+ GObject *client_object;
GError *local_error = NULL;
simple = G_SIMPLE_ASYNC_RESULT (user_data);
@@ -1321,7 +1322,11 @@ book_client_connect_open_cb (GObject *source_object,
e_dbus_address_book_call_open_finish (
E_DBUS_ADDRESS_BOOK (source_object), &properties, result, &local_error);
- book_client_process_properties (E_BOOK_CLIENT (g_async_result_get_source_object (G_ASYNC_RESULT
(simple))), properties);
+ client_object = g_async_result_get_source_object (G_ASYNC_RESULT (simple));
+ if (client_object) {
+ book_client_process_properties (E_BOOK_CLIENT (client_object), properties);
+ g_clear_object (&client_object);
+ }
if (local_error != NULL) {
g_dbus_error_strip_remote_error (local_error);
diff --git a/calendar/libecal/e-cal-client.c b/calendar/libecal/e-cal-client.c
index 1a3d648..f84eb39 100644
--- a/calendar/libecal/e-cal-client.c
+++ b/calendar/libecal/e-cal-client.c
@@ -1639,6 +1639,7 @@ cal_client_connect_open_cb (GObject *source_object,
{
GSimpleAsyncResult *simple;
gchar **properties = NULL;
+ GObject *client_object;
GError *local_error = NULL;
simple = G_SIMPLE_ASYNC_RESULT (user_data);
@@ -1646,7 +1647,11 @@ cal_client_connect_open_cb (GObject *source_object,
e_dbus_calendar_call_open_finish (
E_DBUS_CALENDAR (source_object), &properties, result, &local_error);
- cal_client_process_properties (E_CAL_CLIENT (g_async_result_get_source_object (G_ASYNC_RESULT
(simple))), properties);
+ client_object = g_async_result_get_source_object (G_ASYNC_RESULT (simple));
+ if (client_object) {
+ cal_client_process_properties (E_CAL_CLIENT (client_object), properties);
+ g_clear_object (&client_object);
+ }
if (local_error != NULL) {
g_dbus_error_strip_remote_error (local_error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]