diff src/gtkprefs.c @ 8814:c61be128dff3

[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 <tailor@pidgin.im>
author Ethan Blanton <elb@pidgin.im>
date Mon, 26 Apr 2004 15:46:12 +0000
parents 7329d01bb770
children 61fdef863ffa
line wrap: on
line diff
--- 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);
 				}
 			}
 		}