[gnome-panel/bonobo-less] [panel] Fix removing applets that fail to load



commit 2de4df8952253cc70397fc07197e86475dbbd56d
Author: Vincent Untz <vuntz gnome org>
Date:   Wed May 26 17:08:56 2010 +0200

    [panel] Fix removing applets that fail to load
    
    We were using freed memory...

 gnome-panel/panel-applet-frame.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gnome-panel/panel-applet-frame.c b/gnome-panel/panel-applet-frame.c
index c75ae41..926a328 100644
--- a/gnome-panel/panel-applet-frame.c
+++ b/gnome-panel/panel-applet-frame.c
@@ -847,7 +847,6 @@ panel_applet_frame_loading_failed (const char  *iid,
 	char      *problem_txt;
 	gboolean   locked_down;
 
-	panel_applet_stop_loading (id);
 	no_reload_applets = g_slist_prepend (no_reload_applets,
 					     g_strdup (id));
 
@@ -893,6 +892,10 @@ panel_applet_frame_loading_failed (const char  *iid,
 	gtk_window_set_title (GTK_WINDOW (dialog), _("Error"));
 
 	gtk_widget_show_all (dialog);
+
+	/* Note: this call will free the memory for id, so the variable should
+	 * not get accessed afterwards. */
+	panel_applet_stop_loading (id);
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]