# HG changeset patch # User Ethan Blanton # Date 1082994372 0 # Node ID c61be128dff3ce2f3310d6e8e6f938b159460ce8 # Parent 610bf83cbd933a06ba7ee369eab6da28dea5b412 [gaim-migrate @ 9576] Gary Kramlich says this fixes bugs in code he wrote, so I don't need to mention his name. I think he's just trying to pretend his code didn't have bugs. I'm citing him anyway. committer: Tailor Script diff -r 610bf83cbd93 -r c61be128dff3 src/gtkprefs.c --- a/src/gtkprefs.c Mon Apr 26 15:30:03 2004 +0000 +++ b/src/gtkprefs.c Mon Apr 26 15:46:12 2004 +0000 @@ -363,6 +363,11 @@ prefs_info = GAIM_PLUGIN_UI_INFO(plug); + if(prefs_info->frame != NULL) { + gaim_plugin_pref_frame_destroy(prefs_info->frame); + prefs_info->frame = NULL; + } + if(prefs_info->iter != NULL) { g_free(prefs_info->iter); prefs_info->iter = NULL; @@ -1856,7 +1861,8 @@ iter = plugin_iter; prefs_info = GAIM_PLUGIN_UI_INFO(plug); - pref_frame = gaim_gtk_plugin_pref_create_frame(prefs_info->get_plugin_pref_frame(plug)); + prefs_info->frame = prefs_info->get_plugin_pref_frame(plug); + pref_frame = gaim_gtk_plugin_pref_create_frame(prefs_info->frame); if(pref_frame != NULL) { prefs_info->iter = g_new0(GtkTreeIter, 1); @@ -1894,6 +1900,11 @@ prefs_info = GAIM_PLUGIN_UI_INFO(plug); if(prefs_info != NULL) { + if(prefs_info->frame != NULL) { + gaim_plugin_pref_frame_destroy(prefs_info->frame); + prefs_info->frame = NULL; + } + if(prefs_info->iter != NULL) { gtk_tree_store_remove(GTK_TREE_STORE(prefstree), prefs_info->iter); g_free(prefs_info->iter); @@ -2544,13 +2555,11 @@ if(GAIM_PLUGIN_HAS_PREF_FRAME(plug)) { GtkWidget *gtk_frame; - GaimPluginPrefFrame *pp_frame; GaimPluginUiInfo *prefs_info; prefs_info = GAIM_PLUGIN_UI_INFO(plug); - pp_frame = prefs_info->get_plugin_pref_frame(plug); - gtk_frame = gaim_gtk_plugin_pref_create_frame(pp_frame); - gaim_plugin_pref_frame_destroy(pp_frame); + prefs_info->frame = prefs_info->get_plugin_pref_frame(plug); + gtk_frame = gaim_gtk_plugin_pref_create_frame(prefs_info->frame); if(GTK_IS_WIDGET(gtk_frame)) { prefs_info->iter = g_new0(GtkTreeIter, 1); @@ -2558,6 +2567,12 @@ gtk_frame, prefs_info->iter, (plug->info->type == GAIM_PLUGIN_PROTOCOL) ? &proto_iter : &plugin_iter, notebook_page++); + } else if(prefs_info->frame) { + /* in the event that there is a pref frame and we can + * not make a widget out of it, we free the + * pluginpref frame --Gary + */ + gaim_plugin_pref_frame_destroy(prefs_info->frame); } } } diff -r 610bf83cbd93 -r c61be128dff3 src/plugin.h --- a/src/plugin.h Mon Apr 26 15:30:03 2004 +0000 +++ b/src/plugin.h Mon Apr 26 15:46:12 2004 +0000 @@ -87,7 +87,7 @@ void *ui_info; void *extra_info; - void *prefs_info; + GaimPluginUiInfo *prefs_info; }; /** @@ -127,6 +127,7 @@ GaimPluginPrefFrame *(*get_plugin_pref_frame)(GaimPlugin *plugin); void *iter; /**< Reserved */ + GaimPluginPrefFrame *frame; /**< Reserved */ }; #define GAIM_PLUGIN_HAS_PREF_FRAME(plugin) \