gfio: clear stale widget pointers on dialog destruction
authorStephen M. Cameron <stephenmcameron@gmail.com>
Tue, 20 Mar 2012 06:10:47 +0000 (07:10 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 20 Mar 2012 06:12:51 +0000 (07:12 +0100)
gopt_widgets and gopt_g_widgets arrays need to be cleared when
the job editing dialog widget tree is destroyed, otherwise you
get a crash or weird behavior if you attempt to edit a job more
than once.

Signed-off-by: Stephen M. Cameron <stephenmcameron@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
goptions.c

index 94d60d6..f671dbe 100644 (file)
@@ -708,4 +708,6 @@ void gopt_get_options_window(GtkWidget *window, struct thread_options *o)
        gtk_dialog_run(GTK_DIALOG(dialog));
 
        gtk_widget_destroy(dialog);
+       memset(gopt_widgets, 0, sizeof(gopt_widgets));
+       memset(gopt_g_widgets, 0, sizeof(gopt_g_widgets));
 }