GtkApplicationWindow: Don't unref a NULL object

This commit is contained in:
Colin Walters 2011-12-01 13:29:41 -05:00 committed by Ryan Lortie
parent b42308f8e3
commit 3a088d9ac2

View File

@ -492,8 +492,9 @@ recalculate_app_menu_state (GtkApplicationWindow *window)
}
else
{
gtk_widget_unparent (GTK_WIDGET (window->priv->menubar));
g_object_unref (window->priv->menubar);
if (window->priv->menubar)
gtk_widget_unparent (GTK_WIDGET (window->priv->menubar));
g_clear_object (&window->priv->menubar);
}
}