Fix possible memory leak in lxpanel_generic_config_dlg().
authorAndriy Grytsenko <andrej@rep.kiev.ua>
Thu, 30 Oct 2014 00:48:07 +0000 (02:48 +0200)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Thu, 30 Oct 2014 00:48:07 +0000 (02:48 +0200)
ChangeLog
plugins/volumealsa/volumealsa.c
src/configurator.c

index 68ac5e4..5cc1adf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,6 @@
 * Added workaround for crash in gtk-run with old libmenu-cache.
+* Core functions are separated into a private library to allow reliable
+    linking of modules using -Wl,-z,defs.
 
 0.7.2
 -------------------------------------------------------------------------
index 6a7b841..9c94cd5 100644 (file)
@@ -600,6 +600,7 @@ static GtkWidget *volumealsa_configure(LXPanel *panel, GtkWidget *p)
     /* FIXME: support "needs terminal" for MixerCommand */
     /* FIXME: selection for master channel! */
     /* FIXME: configure buttons for each action (toggle volume/mixer/mute)! */
+    /* FIXME: allow bind multimedia keys to volume using libkeybinder */
 
     /* if command isn't set in settings then let guess it */
     if (command_line == NULL && (path = g_find_program_in_path("pulseaudio")))
index 04a2cbd..203a3f3 100644 (file)
@@ -1400,7 +1400,6 @@ static GtkWidget *_lxpanel_generic_config_dlg(const char *title, Panel *p,
 
     while( name )
     {
-        GtkWidget* label = gtk_label_new( name );
         GtkWidget* entry = NULL;
         gpointer val = va_arg( args, gpointer );
         PluginConfType type = va_arg( args, PluginConfType );
@@ -1417,17 +1416,15 @@ static GtkWidget *_lxpanel_generic_config_dlg(const char *title, Panel *p,
                   G_CALLBACK(on_entry_focus_out_old), val );
                 break;
             case CONF_TYPE_INT:
-            {
                 /* FIXME: the range shouldn't be hardcoded */
                 entry = gtk_spin_button_new_with_range( 0, 1000, 1 );
                 gtk_spin_button_set_value( GTK_SPIN_BUTTON(entry), *(int*)val );
                 g_signal_connect( entry, "value-changed",
                   G_CALLBACK(on_spin_changed), val );
                 break;
-            }
             case CONF_TYPE_BOOL:
                 entry = gtk_check_button_new();
-                gtk_container_add( GTK_CONTAINER(entry), label );
+                gtk_container_add(GTK_CONTAINER(entry), gtk_label_new(name));
                 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(entry), *(gboolean*)val );
                 g_signal_connect( entry, "toggled",
                   G_CALLBACK(on_toggle_changed), val );
@@ -1455,7 +1452,7 @@ static GtkWidget *_lxpanel_generic_config_dlg(const char *title, Panel *p,
             else
             {
                 GtkWidget* hbox = gtk_hbox_new( FALSE, 2 );
-                gtk_box_pack_start( GTK_BOX(hbox), label, FALSE, FALSE, 2 );
+                gtk_box_pack_start( GTK_BOX(hbox), gtk_label_new(name), FALSE, FALSE, 2 );
                 gtk_box_pack_start( GTK_BOX(hbox), entry, TRUE, TRUE, 2 );
                 gtk_box_pack_start( dlg_vbox, hbox, FALSE, FALSE, 2 );
                 if ((type == CONF_TYPE_FILE_ENTRY) || (type == CONF_TYPE_DIRECTORY_ENTRY))