gdk: Make gdk_display_peek_event() Return a reference to the event
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 31 Oct 2017 14:40:16 +0000 (15:40 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 14 Dec 2017 00:05:48 +0000 (01:05 +0100)
No need to copy it.

gdk/gdkdisplay.c

index bd43125192d12330a78fe8caa360a8b36b3f1756..0e6baeea3a3a2fb18481eb661d86eafa39fe10a1 100644 (file)
@@ -481,7 +481,7 @@ gdk_display_get_event (GdkDisplay *display)
  * 
  * Returns: (nullable): a copy of the first #GdkEvent on the event
  * queue, or %NULL if no events are in the queue. The returned
- * #GdkEvent should be freed with gdk_event_free().
+ * #GdkEvent should be freed with g_object_unref().
  *
  * Since: 2.2
  **/
@@ -495,7 +495,7 @@ gdk_display_peek_event (GdkDisplay *display)
   tmp_list = _gdk_event_queue_find_first (display);
   
   if (tmp_list)
-    return gdk_event_copy (tmp_list->data);
+    return g_object_ref (tmp_list->data);
   else
     return NULL;
 }