[evolution-ews/gnome-2-28] Fix a corner case for a leak fix from bug #665801
- From: Punit Jain <jpunit src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-ews/gnome-2-28] Fix a corner case for a leak fix from bug #665801
- Date: Tue, 20 Mar 2012 12:52:33 +0000 (UTC)
commit ddc444c08d44aa024d3e7f80fd66fac4372e6c47
Author: Milan Crha <mcrha redhat com>
Date: Wed Mar 14 20:55:42 2012 +0100
Fix a corner case for a leak fix from bug #665801
src/server/e-ews-connection.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/server/e-ews-connection.c b/src/server/e-ews-connection.c
index e17c701..bfeba6b 100644
--- a/src/server/e-ews-connection.c
+++ b/src/server/e-ews-connection.c
@@ -1225,6 +1225,7 @@ autodiscover_response_cb (SoupSession *session, SoupMessage *msg, gpointer data)
xmlNode *node;
int idx;
gboolean success = FALSE;
+ GSimpleAsyncResult *simple;
for (idx = 0; idx < 4; idx++) {
if (ad->msgs[idx] == msg)
@@ -1237,6 +1238,13 @@ autodiscover_response_cb (SoupSession *session, SoupMessage *msg, gpointer data)
ad->msgs[idx] = NULL;
+ /* Take 'simple' from 'ad' before actual call
+ to g_simple_async_result_complete_in_idle(),
+ for cases where the 'ad' is freed in autodiscover_done_cb()
+ before this function finishes. Suggested by Dan Winship.
+ */
+ simple = ad->simple;
+
if (status != 200) {
g_set_error (
&error, EWS_CONNECTION_ERROR,
@@ -1320,7 +1328,7 @@ autodiscover_response_cb (SoupSession *session, SoupMessage *msg, gpointer data)
g_simple_async_result_set_op_res_gpointer (ad->simple, urls, NULL);
g_simple_async_result_complete_in_idle (ad->simple);
- g_object_unref (ad->simple);
+ g_object_unref (simple);
return;
failed:
@@ -1339,7 +1347,7 @@ failed:
want the *first* error */
g_simple_async_result_set_from_error (ad->simple, error);
g_simple_async_result_complete_in_idle (ad->simple);
- g_object_unref (ad->simple);
+ g_object_unref (simple);
}
static void post_restarted (SoupMessage *msg, gpointer data)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]