[gnome-panel] panel.c: don't crash clicking on panel handle
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] panel.c: don't crash clicking on panel handle
- Date: Mon, 24 Nov 2014 03:35:40 +0000 (UTC)
commit 098df5e7bc0b0778e51b3b0410c0587eec62f952
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Fri Nov 21 04:18:36 2014 +0200
panel.c: don't crash clicking on panel handle
Documentation says that gtk_get_current_event can return NULL.
Also returned value must be freed.
https://developer.gnome.org/gtk3/stable/gtk3-General.html#gtk-get-current-event
gnome-panel/panel.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gnome-panel/panel.c b/gnome-panel/panel.c
index c952f68..26b5322 100644
--- a/gnome-panel/panel.c
+++ b/gnome-panel/panel.c
@@ -309,11 +309,16 @@ panel_popup_menu (PanelToplevel *toplevel,
panel_data = g_object_get_data (G_OBJECT (toplevel), "PanelData");
current_event = gtk_get_current_event ();
+ if (!current_event)
+ return FALSE;
+
if (current_event->type == GDK_BUTTON_PRESS)
panel_data->insert_pack_type = panel_widget_get_insert_pack_type_at_cursor (panel_widget);
else
panel_data->insert_pack_type = PANEL_OBJECT_PACK_START;
-
+
+ gdk_event_free (current_event);
+
menu = make_popup_panel_menu (panel_widget);
if (!menu)
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]