[gtk+/wip/attach-params-2: 3/13] 99db2f96 gtkmenu: don't sink references on failure
- From: William Hua <williamhua src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/attach-params-2: 3/13] 99db2f96 gtkmenu: don't sink references on failure
- Date: Fri, 19 Feb 2016 19:14:39 +0000 (UTC)
commit 374a79ab8a00cdb4939e4b07f159dad8369642c5
Author: William Hua <william hua canonical com>
Date: Thu Feb 18 12:43:17 2016 -0500
99db2f96 gtkmenu: don't sink references on failure
gtk/gtkmenu.c | 21 +++++----------------
1 files changed, 5 insertions(+), 16 deletions(-)
---
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 5d213e7..0059056 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -1564,17 +1564,12 @@ gtk_menu_popup_internal (GtkMenu *menu,
GdkDevice *source_device = NULL;
GdkDisplay *display;
- if (params)
- {
- g_object_ref_sink (params);
-
- if (!GTK_IS_MENU (menu) || (seat && !GDK_IS_SEAT (seat)))
- g_clear_object (¶ms);
- }
-
g_return_if_fail (GTK_IS_MENU (menu));
g_return_if_fail (!seat || GDK_IS_SEAT (seat));
+ if (params)
+ g_object_ref_sink (params);
+
if (!seat)
{
current_event = gtk_get_current_event ();
@@ -1736,8 +1731,8 @@ gtk_menu_popup_internal (GtkMenu *menu,
priv->position_func_data_destroy = destroy;
menu_shell->priv->activate_time = activate_time;
- g_set_object (&priv->attach_params, params);
- g_clear_object (¶ms);
+ g_clear_object (&priv->attach_params);
+ priv->attach_params = params;
/* We need to show the menu here rather in the init function
* because code expects to be able to tell if the menu is onscreen
@@ -1957,12 +1952,6 @@ gtk_menu_popup_with_params (GtkMenu *menu,
gint x;
gint y;
- if (!GTK_IS_MENU (menu) && params)
- {
- g_object_ref_sink (params);
- g_clear_object (¶ms);
- }
-
g_return_if_fail (GTK_IS_MENU (menu));
if (seat)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]