[gtk+] Don't try to unref event->dnd.context unconditionally.



commit 41f4fd94df39ba03c3cab8c94b41a2993ad36591
Author: Tomeu Vizoso <tomeu vizoso collabora co uk>
Date:   Fri Sep 24 16:30:07 2010 +0200

    Don't try to unref event->dnd.context unconditionally.
    
    As it's not set in gdk_event_new but eventually later.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=630520

 gdk/gdkevents.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index 053e6d5..b8213d5 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -540,7 +540,8 @@ gdk_event_free (GdkEvent *event)
     case GDK_DRAG_STATUS:
     case GDK_DROP_START:
     case GDK_DROP_FINISHED:
-      g_object_unref (event->dnd.context);
+      if (event->dnd.context != NULL)
+        g_object_unref (event->dnd.context);
       break;
 
     case GDK_BUTTON_PRESS:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]