inspector: Properly clean up

I got a crash in inspector code when I hit
cancel in the confirmation dialog for it.
This commit is contained in:
Matthias Clasen 2019-04-02 21:19:50 +00:00
parent df19224b20
commit 12c4766dd0

View File

@ -258,6 +258,14 @@ gtk_inspector_window_constructed (GObject *object)
g_object_set_data (G_OBJECT (gdk_display_get_default ()), "-gtk-inspector", iw);
}
static void
gtk_inspector_window_dispose (GObject *object)
{
g_object_set_data (G_OBJECT (gdk_display_get_default ()), "-gtk-inspector", NULL);
G_OBJECT_CLASS (gtk_inspector_window_parent_class)->dispose (object);
}
static void
object_details_changed (GtkWidget *combo,
GParamSpec *pspec,
@ -284,6 +292,7 @@ gtk_inspector_window_class_init (GtkInspectorWindowClass *klass)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->constructed = gtk_inspector_window_constructed;
object_class->dispose = gtk_inspector_window_dispose;
widget_class->realize = gtk_inspector_window_realize;
g_signal_new (g_intern_static_string ("event"),