fix a small memory leak in case user cancels the selection after new items appeared...
authormishas <mikhail.sobolev@gmail.com>
Mon, 2 Apr 2007 15:45:12 +0000 (15:45 +0000)
committermishas <mikhail.sobolev@gmail.com>
Mon, 2 Apr 2007 15:45:12 +0000 (15:45 +0000)
git-svn-id: file:///svnroot/simple-launcher/trunk@136 3ba93dab-e023-0410-b42a-de7732cf370a

simple-launcher.cc

index 47c61cd..355c181 100644 (file)
@@ -326,9 +326,11 @@ void SimpleLauncherApplet::_run_dialog(GtkMenuItem *, void *self) {
 }
 
 void SimpleLauncherApplet::runDialog() {
-  LauncherItems newItems = myItems;
+  // We update the items before using them to avoid a small memory leak
+  // FIXME: deal with the situation in a better way (figure it out first :))
+  updateItems(myItems);       // User requested 'settings', let's give her the latest stuff :)
 
-  updateItems(newItems);  // User requested 'settings', let's give her the latest stuff :)
+  LauncherItems newItems = myItems;
 
   SLAList list(SL_APPLET_ICON_SIZE, newItems);