gtk-demo: Fix fishbowl setup

The fishbowl demo was failing to reset a static variable
when setting up, causing it to crash the second time around.

Closes: #1665
This commit is contained in:
Matthias Clasen 2019-02-11 08:24:06 -05:00
parent 46fba85ed7
commit 220ccaf363

View File

@ -264,7 +264,10 @@ do_fishbowl (GtkWidget *do_widget)
NULL);
gtk_builder_connect_signals (builder, NULL);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
bowl = GTK_WIDGET (gtk_builder_get_object (builder, "bowl"));
selected_widget_type = -1;
set_widget_type (GTK_FISHBOWL (bowl), 0);
gtk_window_set_display (GTK_WINDOW (window),
gtk_widget_get_display (do_widget));
@ -279,6 +282,5 @@ do_fishbowl (GtkWidget *do_widget)
else
gtk_widget_destroy (window);
return window;
}