widget: Take a ref during ::unmap emission

This ensures the widget data stays live long enough to perform invariants
check after emission if the widget happens to be destroyed on a callback.

https://bugzilla.gnome.org/show_bug.cgi?id=745829
This commit is contained in:
Carlos Garnacho
2015-03-16 13:45:03 +01:00
committed by Matthias Clasen
parent 81da1b0274
commit 9fd9c4b0af

View File

@@ -5072,6 +5072,7 @@ gtk_widget_unmap (GtkWidget *widget)
if (gtk_widget_get_mapped (widget))
{
g_object_ref (widget);
gtk_widget_push_verify_invariants (widget);
if (!gtk_widget_get_has_window (widget))
@@ -5084,6 +5085,7 @@ gtk_widget_unmap (GtkWidget *widget)
g_signal_emit (widget, widget_signals[UNMAP], 0);
gtk_widget_pop_verify_invariants (widget);
g_object_unref (widget);
}
}