xvimagesink: fix navigation event leak when not handled
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 4 May 2015 16:00:18 +0000 (18:00 +0200)
committerThiago Santos <thiagoss@osg.samsung.com>
Tue, 5 May 2015 16:54:08 +0000 (13:54 -0300)
gst_navigation_message_new_event() is *not* consuming the event so we should
always drop our extra reference.

https://bugzilla.gnome.org/show_bug.cgi?id=748903

sys/xvimage/xvimagesink.c

index 38f9de8..6112545 100644 (file)
@@ -1185,8 +1185,6 @@ gst_xvimagesink_navigation_send_event (GstNavigation * navigation,
 
     gst_event_ref (event);
     handled = gst_pad_send_event (peer, event);
-    if (handled)
-      gst_event_unref (event);
     gst_object_unref (peer);
   }
 
@@ -1194,6 +1192,9 @@ gst_xvimagesink_navigation_send_event (GstNavigation * navigation,
     gst_element_post_message ((GstElement *) xvimagesink,
         gst_navigation_message_new_event ((GstObject *) xvimagesink, event));
   }
+
+  if (event)
+    gst_event_unref (event);
 }
 
 static void