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 94d60d6c6f1be80561406a5df8edad5ac36915dd..f671dbec1c9e0f43b57285b854c32892ab151a7c 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));
 }