/soc/2015/jgeboski/facebook: c639b134dbe6: Backed out changeset ...

James Geboski jgeboski at gmail.com
Sat Aug 15 18:26:07 EDT 2015


Changeset: c639b134dbe68eb984a87eadd4ac800adc7f92ec
Author:	 James Geboski <jgeboski at gmail.com>
Date:	 2015-08-15 17:16 -0400
Branch:	 facebook
URL: https://hg.pidgin.im/soc/2015/jgeboski/facebook/rev/c639b134dbe6

Description:

Backed out changeset ce9c78335820

This leads to the HTTP connection being doubly freed.

diffstat:

 libpurple/protocols/facebook/api.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (43 lines):

diff --git a/libpurple/protocols/facebook/api.c b/libpurple/protocols/facebook/api.c
--- a/libpurple/protocols/facebook/api.c
+++ b/libpurple/protocols/facebook/api.c
@@ -143,11 +143,14 @@ fb_api_dispose(GObject *obj)
 {
 	FbApiPrivate *priv = FB_API(obj)->priv;
 
+	if (G_LIKELY(priv->gc != NULL)) {
+		purple_http_conn_cancel_all(priv->gc);
+	}
+
 	if (G_UNLIKELY(priv->mqtt != NULL)) {
 		g_object_unref(priv->mqtt);
 	}
 
-	purple_http_conn_cancel_all(priv->gc);
 	g_hash_table_destroy(priv->msgids);
 
 	g_free(priv->cid);
@@ -1572,7 +1575,6 @@ fb_api_new(PurpleConnection *gc)
 	FbApi *api;
 	FbApiPrivate *priv;
 
-	g_return_val_if_fail(PURPLE_IS_CONNECTION(gc), NULL);
 	api = g_object_new(FB_TYPE_API, NULL);
 	priv = api->priv;
 
@@ -1658,7 +1660,6 @@ fb_api_error_emit(FbApi *api, GError *er
 	g_return_if_fail(error != NULL);
 
 	g_signal_emit_by_name(api, "error", error);
-	fb_api_disconnect(api);
 	g_error_free(error);
 }
 
@@ -1963,7 +1964,6 @@ fb_api_disconnect(FbApi *api)
 	g_return_if_fail(FB_IS_API(api));
 	priv = api->priv;
 
-	purple_http_conn_cancel_all(priv->gc);
 	fb_mqtt_disconnect(priv->mqtt);
 }
 



More information about the Commits mailing list