goptions: ensure that gopt_str_multi options get freed
authorJens Axboe <axboe@kernel.dk>
Mon, 26 Mar 2012 12:28:36 +0000 (14:28 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 26 Mar 2012 12:28:36 +0000 (14:28 +0200)
Was missing the destroy handler.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
goptions.c

index b84a047..87d92e6 100644 (file)
@@ -337,6 +337,14 @@ static void gopt_str_multi_toggled(GtkToggleButton *button, gpointer data)
        gopt_changed(&m->gopt);
 }
 
+static void gopt_str_multi_destroy(GtkWidget *w, gpointer data)
+{
+       struct gopt_str_multi *m = (struct gopt_str_multi *) data;
+
+       free(m);
+       gtk_widget_destroy(w);
+}
+
 static struct gopt *gopt_new_str_multi(struct gopt_job_view *gjv,
                                       struct fio_option *o, unsigned int idx)
 {
@@ -369,6 +377,7 @@ static struct gopt *gopt_new_str_multi(struct gopt_job_view *gjv,
                i++;
        }
 
+       g_signal_connect(G_OBJECT(m->gopt.box), "destroy", G_CALLBACK(gopt_str_multi_destroy), m);
        return &m->gopt;
 }