gtkselectioninputstream-x11: Do not add EOF marker twice to the chunks queue
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Tue, 30 May 2023 15:42:59 +0000 (17:42 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 5 Jun 2023 12:01:22 +0000 (08:01 -0400)
We were adding the same EOF marker two times back to the chunks queue,
one implicitly, and the other time could happen when exiting the loop.

gdk/x11/gdkselectioninputstream-x11.c

index e6bc574409ab6788c3a64f08741f69eb5430acfd..7ea92ef368855bd5adc26f1f15e99e2edfc4bf2c 100644 (file)
@@ -89,7 +89,7 @@ gdk_x11_selection_input_stream_fill_buffer (GdkX11SelectionInputStream *stream,
     if (size == 0)
       {
         /* EOF marker, put it back */
-        g_async_queue_push_front_unlocked (priv->chunks, bytes);
+        g_async_queue_push_front_unlocked (priv->chunks, g_steal_pointer (&bytes));
         break;
       }
     else if (size > count)