org.guifications.plugins: de1c64fd71e3b7332bcab70bb7b5299db54e010e

nosnilmot at guifications.org nosnilmot at guifications.org
Wed Mar 12 20:40:11 CDT 2008


-----------------------------------------------------------------
Revision: de1c64fd71e3b7332bcab70bb7b5299db54e010e
Ancestor: c108d2038ff4394d673a2d3cceb41a155357cb5c
Author: nosnilmot at guifications.org
Date: 2008-03-13T01:16:53
Branch: org.guifications.plugins

Modified files:
        album/album-ui.c album/album-ui.h album/album.c

ChangeLog: 

Leak fix

-----------------------------------------------------------------
This revision's diffstat output:
 album-ui.c |    9 +++++++++
 album-ui.h |    2 ++
 album.c    |    2 +-
 3 files changed, 12 insertions(+), 1 deletion(-)
-------------- next part --------------
============================================================
--- album/album-ui.c	defda9fe454d549f137830c492e92a1bfa6fa89a
+++ album/album-ui.c	d4365be2ab9f1ad37b203d11f6f9438ec85ab58c
@@ -126,6 +126,13 @@ static void show_buddy_icon_window(icon_
 static void update_icon_view(icon_viewer_key *key);
 static void show_buddy_icon_window(icon_viewer_key *key, const char *name);
 
+void icon_viewer_key_free(void *data)
+{
+	icon_viewer_key *key = (icon_viewer_key *)data;
+	g_free(key->screenname);
+	g_free(key);
+}
+
 guint icon_viewer_hash(gconstpointer data)
 {
 	const icon_viewer_key *key = data;
@@ -932,6 +939,7 @@ static void show_buddy_icon_window(icon_
 	/* Return if a window is already opened for the buddy. */
 	if ((bw = g_hash_table_lookup(buddy_windows, key)) != NULL)
 	{
+		icon_viewer_key_free(key);
 		gtk_window_present(GTK_WINDOW(bw->window));
 		return;
 	}
@@ -942,6 +950,7 @@ static void show_buddy_icon_window(icon_
 	if (key->contact == NULL &&
 	    (bw = g_hash_table_find(buddy_windows, (GHRFunc)compare_buddy_keys, key)) != NULL)
 	{
+		icon_viewer_key_free(key);
 		gtk_window_present(GTK_WINDOW(bw->window));
 		return;
 	}
============================================================
--- album/album-ui.h	f488b4417d2ab690a24b1dc5d8fab89a4e2f1e6f
+++ album/album-ui.h	51ffa82404a54d18628ede91acb6c871734c5667
@@ -36,6 +36,8 @@ gboolean icon_viewer_equal(gconstpointer
 
 gboolean icon_viewer_equal(gconstpointer y, gconstpointer z);
 
+void icon_viewer_key_free(void *key);
+
 GList *album_get_plugin_actions(PurplePlugin *plugin, gpointer data);
 
 void album_blist_node_menu_cb(PurpleBlistNode *node, GList **menu);
============================================================
--- album/album.c	6ea8e9f67d5f444501f2443ab37ce8aef3e489cb
+++ album/album.c	56fd11b5aa714e262d3a5c6a535e81fdc17294be
@@ -253,7 +253,7 @@ static gboolean plugin_load(PurplePlugin
 
 	cache_existing_icons(NULL);
 
-	buddy_windows = g_hash_table_new_full(icon_viewer_hash, icon_viewer_equal, g_free, g_free);
+	buddy_windows = g_hash_table_new_full(icon_viewer_hash, icon_viewer_equal, icon_viewer_key_free, g_free);
 
 	return TRUE;
 }


More information about the Plugins-commits mailing list