[gtk+/wip/gmenu] GtkApplicationWindow: Don't unref a NULL object
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/gmenu] GtkApplicationWindow: Don't unref a NULL object
- Date: Thu, 1 Dec 2011 18:30:29 +0000 (UTC)
commit e536582f8333629d0e532ad9a96946d521c5ec0c
Author: Colin Walters <walters verbum org>
Date: Thu Dec 1 13:29:41 2011 -0500
GtkApplicationWindow: Don't unref a NULL object
gtk/gtkapplicationwindow.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkapplicationwindow.c b/gtk/gtkapplicationwindow.c
index 1c47330..7d04770 100644
--- a/gtk/gtkapplicationwindow.c
+++ b/gtk/gtkapplicationwindow.c
@@ -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);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]