im.pidgin.pidgin.next.minor: bd8f1d754a1b94e5ade30c3b135178b236f7b49a

rlaager at pidgin.im rlaager at pidgin.im
Sun Oct 14 20:55:40 EDT 2007


-----------------------------------------------------------------
Revision: bd8f1d754a1b94e5ade30c3b135178b236f7b49a
Ancestor: ddd8161138d003646cb2960438fe8011a3d71a8b
Author: rlaager at pidgin.im
Date: 2007-10-15T00:41:22
Branch: im.pidgin.pidgin.next.minor

Modified files:
        ChangeLog.API libpurple/core.c libpurple/util.c
        libpurple/util.h

ChangeLog: 

Add and call a purple_util_uninit() to free user_dir and customer_home_dir
at shutdown.  Fixes #3132

-------------- next part --------------
============================================================
--- ChangeLog.API	eb47e65688d2a4bdd14428b050ec248db8056175
+++ ChangeLog.API	28ec377d4f63201ba254cfcfc274c1872c7a953f
@@ -14,6 +14,8 @@ version 2.3.0 (??/??/????):
 		  to unload a plugin--fails.  This then prevents the plugin
 		  from being saved in the saved plugins list, so it'll won't
 		  be loaded at the next startup.
+		* purple_util_init()
+		* purple_util_uninit()
 
 		* pidgin_dialogs_about_with_parent()
 		* pidgin_log_show_contact_with_parent()
============================================================
--- libpurple/core.c	f4f5b2c6ec48ed3a5f96545d2f3049e5ea0253b2
+++ libpurple/core.c	653769a1381c3bedd82f42ff8cee9c01415e5c23
@@ -94,6 +94,8 @@ purple_core_init(const char *ui)
 	/* The signals subsystem is important and should be first. */
 	purple_signals_init();
 
+	purple_util_init();
+
 	purple_signal_register(core, "uri-handler",
 		purple_marshal_BOOLEAN__POINTER_POINTER_POINTER,
 		purple_value_new(PURPLE_TYPE_BOOLEAN), 3,
@@ -229,6 +231,9 @@ purple_core_quit(void)
 #ifdef HAVE_DBUS
 	purple_dbus_uninit();
 #endif
+
+	purple_util_uninit();
+
 	purple_signals_uninit();
 
 	g_free(core->ui);
============================================================
--- libpurple/util.c	bb614dd45ec36a524a1e2d62568d5cac522d2c93
+++ libpurple/util.c	4f660df5ba1ac3513c825a20fbd1cf9bfee79be6
@@ -70,6 +70,7 @@ static char *user_dir = NULL;
 static char *custom_user_dir = NULL;
 static char *user_dir = NULL;
 
+
 PurpleMenuAction *
 purple_menu_action_new(const char *label, PurpleCallback callback, gpointer data,
                      GList *children)
@@ -91,6 +92,25 @@ purple_menu_action_free(PurpleMenuAction
 	g_free(act);
 }
 
+void
+purple_util_init(void)
+{
+	/* This does nothing right now.  It exists for symmetry with 
+	 * purple_util_uninit() and forwards compatibility. */
+}
+
+void
+purple_util_uninit(void)
+{
+	/* Free these so we don't have leaks at shutdown. */
+
+	g_free(custom_user_dir);
+	custom_user_dir = NULL;
+
+	g_free(user_dir);
+	user_dir = NULL;
+}
+
 /**************************************************************************
  * Base16 Functions
  **************************************************************************/
============================================================
--- libpurple/util.h	b442b1700aeece6f1f6678fde481ea534404557d
+++ libpurple/util.h	ffcb6eba7a5d6611d36c251612d564a1a7051c87
@@ -86,6 +86,27 @@ void purple_menu_action_free(PurpleMenuA
 void purple_menu_action_free(PurpleMenuAction *act);
 
 /**************************************************************************/
+/** @name Utility Subsystem                                               */
+/**************************************************************************/
+/*@{*/
+
+/**
+ * Initializes the utility subsystem.
+ *
+ * @since 2.3.0
+ */
+void purple_util_init(void);
+
+/**
+ * Uninitializes the util subsystem.
+ *
+ * @since 2.3.0
+ */
+void purple_util_uninit(void);
+
+/*@}*/
+
+/**************************************************************************/
 /** @name Base16 Functions                                                */
 /**************************************************************************/
 /*@{*/


More information about the Commits mailing list