cpw.nader.asynclogging-3: 17498bef: Fixed an issue that was causing crashes ...

morshed.nader at gmail.com morshed.nader at gmail.com
Sat Jan 7 22:01:53 EST 2012


----------------------------------------------------------------------
Revision: 17498befb6aeeeb4253902c47056c06775b14b06
Parent:   ee94bde9b570987da9de046f56639d859293ad36
Author:   morshed.nader at gmail.com
Date:     01/06/12 12:11:16
Branch:   im.pidgin.cpw.nader.asynclogging-3
URL: http://d.pidgin.im/viewmtn/revision/info/17498befb6aeeeb4253902c47056c06775b14b06

Changelog: 

Fixed an issue that was causing crashes when listing logs

Changes against parent ee94bde9b570987da9de046f56639d859293ad36

  patched  libpurple/commonlog.c
  patched  libpurple/log.c

-------------- next part --------------
============================================================
--- libpurple/log.c	5815186ea1542d70efb38648f8821f1da4df5abf
+++ libpurple/log.c	de7cf900f53c7a435cca9cdae197c13f80ea590e
@@ -2011,10 +2011,11 @@ log_list_cb(GObject *object, GAsyncResul
 log_list_cb(GObject *object, GAsyncResult *res, gpointer userdata)
 {
 	_list_logs_callback_data *data = userdata;
-	GError *error = NULL;
-	GList *list;
 
 	if (res != NULL) {
+		GError *error = NULL;
+		GList *list;
+
 		list = purple_logs_list_logs_finish(res, &error);
 
 		if (list == NULL) {
@@ -2052,10 +2053,11 @@ log_system_list_cb(GObject *object, GAsy
 log_system_list_cb(GObject *object, GAsyncResult *res, gpointer userdata)
 {
 	_list_logs_callback_data *data = userdata;
-	GError *error = NULL;
-	GList *list;
 
 	if (res != NULL) {
+		GError *error = NULL;
+		GList *list;
+
 		list = purple_logs_list_system_logs_finish(res, &error);
 
 		if (list == NULL) {
============================================================
--- libpurple/commonlog.c	f11617d875efcb112fbce3153cd7ad98ab55df21
+++ libpurple/commonlog.c	72483c0d5a5f2cfd79ac4bf1b01fd149dad126ba
@@ -1081,11 +1081,13 @@ purple_common_log_list_async_3(GObject *
 	g_list_free(file_infos);
 	g_free(dir_path);
 
-	SIMPLE_ASYNC_RESULT_NEW_GOOD(NULL, data->cb, data->userdata,
-		purple_common_log_list_async,
-		g_simple_async_result_set_op_res_gpointer,
-		logs,
-		(GDestroyNotify) purple_log_list_free);
+	if (logs != NULL) {
+		SIMPLE_ASYNC_RESULT_NEW_GOOD(NULL, data->cb, data->userdata,
+			purple_common_log_list_async,
+			g_simple_async_result_set_op_res_gpointer,
+			logs,
+			(GDestroyNotify) purple_log_list_free);
+	}
 
 	g_file_enumerator_next_files_async(enumerator, 20, data->io_priority,
 		data->cancel, purple_common_log_list_async_3, data);
@@ -1104,13 +1106,14 @@ purple_common_log_list_async_4(GObject *
 
 	if (!result) {
 		SIMPLE_ASYNC_RESULT_FROM_ERROR(NULL, data->cb, data->userdata, err);
-	} else
+	} else {
 		/* Everything went fine, notify the user of the logs */
 		SIMPLE_ASYNC_RESULT_NEW_GOOD(NULL, data->cb, data->userdata,
 			purple_common_log_list_async,
 			g_simple_async_result_set_op_res_gpointer,
 			NULL,
 			NULL);
+	}
 
 	list_callback_data_free(data);
 }


More information about the Commits mailing list