Release leaking volume window.
authorJim Huang <jserv.tw@gmail.com>
Sun, 8 Oct 2006 08:52:05 +0000 (08:52 +0000)
committerJim Huang <jserv.tw@gmail.com>
Sun, 8 Oct 2006 08:52:05 +0000 (08:52 +0000)
src/plugins/volume/volume-impl.c
src/plugins/volume/volume.c

index 65dbd73..5262027 100644 (file)
@@ -74,7 +74,7 @@ create_volume_window (void)
        gtk_container_add (GTK_CONTAINER (frame), vbox1);
        gtk_container_add (GTK_CONTAINER (volume_window), frame);
        gtk_widget_show (frame);
-       vol_adjustment=GTK_ADJUSTMENT (gtk_adjustment_new (1, 0, 100, 1, 10, 0));
+       vol_adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (1, 0, 100, 1, 10, 0));
 
        /* get original adjustments */
        get_current_levels();
@@ -84,8 +84,10 @@ create_volume_window (void)
        gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, TRUE, 8);
 
 
-       spinbutton1 = gtk_spin_button_new (GTK_ADJUSTMENT (vol_adjustment),1,0); /* ajustment, climb rate, digits */
+       /* ajustment, climb rate, digits */
+       spinbutton1 = gtk_spin_button_new (GTK_ADJUSTMENT (vol_adjustment), 1, 0);
        gtk_widget_show (spinbutton1);
+
        gtk_box_pack_start (GTK_BOX (hbox1), spinbutton1, TRUE, FALSE, 0);
        gtk_widget_set_size_request (spinbutton1, -1, 22);
        g_signal_connect ((gpointer) spinbutton1, "value_changed",
@@ -142,7 +144,6 @@ create_volume_window (void)
 }
 
 static StereoVolume vol;
-extern int mixer_fd;                    
 
 static gboolean 
 on_spinbutton1_button_release_event (GtkWidget *widget, 
index be0fc3b..97c52a8 100644 (file)
@@ -28,6 +28,8 @@ volume_destructor(plugin *p)
        volume_t *ns = (volume_t *) p->priv;
 
        ENTER;
+       if (ns->dlg)
+               gtk_widget_destroy(ns->dlg);
        gtk_widget_destroy(ns->mainw);
        if (mixer_fd)
                close(mixer_fd);
@@ -88,6 +90,7 @@ volume_constructor(plugin *p)
                        G_CALLBACK(on_button_press), p );
        gtk_widget_set_size_request( ns->mainw, 24, 24 );
 
+       ns->dlg = NULL;
        gtk_widget_show_all(ns->mainw);
 
        gtk_container_add(GTK_CONTAINER(p->pwid), ns->mainw);