From: Marco Trevisan (TreviƱo) Date: Tue, 30 May 2023 15:54:00 +0000 (+0200) Subject: gdkselectioninputstream-x11: Make it clearer how we manage the stream ownership X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~3^2~1^2~13 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=6c9a1c51ba0ee29e05a3a05c3450e273f955af79;p=gtk4.git gdkselectioninputstream-x11: Make it clearer how we manage the stream ownership It gets unreffed during gdk_x11_selection_input_stream_complete, so use APIs that make this clearer. --- diff --git a/gdk/x11/gdkselectioninputstream-x11.c b/gdk/x11/gdkselectioninputstream-x11.c index 5d480cf6ab..e62bd96035 100644 --- a/gdk/x11/gdkselectioninputstream-x11.c +++ b/gdk/x11/gdkselectioninputstream-x11.c @@ -416,7 +416,7 @@ gdk_x11_selection_input_stream_xevent (GdkDisplay *display, "%s:%s: got PropertyNotify erroring out of INCR", priv->selection, priv->target); /* error, should we signal one? */ - gdk_x11_selection_input_stream_complete (stream); + g_clear_pointer (&stream, gdk_x11_selection_input_stream_complete); } else if (g_bytes_get_size (bytes) == 0 || type == None) { @@ -424,7 +424,7 @@ gdk_x11_selection_input_stream_xevent (GdkDisplay *display, "%s:%s: got PropertyNotify ending INCR", priv->selection, priv->target); g_bytes_unref (bytes); - gdk_x11_selection_input_stream_complete (stream); + g_clear_pointer (&stream, gdk_x11_selection_input_stream_complete); } else { @@ -467,7 +467,7 @@ gdk_x11_selection_input_stream_xevent (GdkDisplay *display, G_IO_ERROR, G_IO_ERROR_NOT_FOUND, _("Format %s not supported"), priv->target); - gdk_x11_selection_input_stream_complete (stream); + g_clear_pointer (&stream, gdk_x11_selection_input_stream_complete); } else { @@ -478,7 +478,7 @@ gdk_x11_selection_input_stream_xevent (GdkDisplay *display, if (bytes == NULL) { - gdk_x11_selection_input_stream_complete (stream); + g_clear_pointer (&stream, gdk_x11_selection_input_stream_complete); } else { @@ -500,7 +500,7 @@ gdk_x11_selection_input_stream_xevent (GdkDisplay *display, g_bytes_get_size (bytes)); g_async_queue_push (priv->chunks, bytes); - gdk_x11_selection_input_stream_complete (stream); + g_clear_pointer (&stream, gdk_x11_selection_input_stream_complete); } }