[libsoup/carlosgc/server-connection-steal: 9/9] server-connection: attach a ref of the socket to io stream on steal
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup/carlosgc/server-connection-steal: 9/9] server-connection: attach a ref of the socket to io stream on steal
- Date: Fri, 14 Oct 2022 12:01:53 +0000 (UTC)
commit 5ce3a206aeaab8c01431ead75ea8107729447d8b
Author: Carlos Garcia Campos <cgarcia igalia com>
Date: Wed Oct 12 08:45:40 2022 +0200
server-connection: attach a ref of the socket to io stream on steal
Previously we transferred the ownership of the socket to the io stream,
but now we keep the ref in the connection that can be disposed before
the io stream.
libsoup/server/soup-server-connection.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/libsoup/server/soup-server-connection.c b/libsoup/server/soup-server-connection.c
index ac0f1aaa..380ac42b 100644
--- a/libsoup/server/soup-server-connection.c
+++ b/libsoup/server/soup-server-connection.c
@@ -549,9 +549,10 @@ soup_server_connection_steal (SoupServerConnection *conn)
priv = soup_server_connection_get_instance_private (conn);
stream = priv->io_data ? soup_server_message_io_steal (priv->io_data) : NULL;
- if (stream) {
+ if (stream && priv->socket) {
g_object_set_data_full (G_OBJECT (stream), "GSocket",
- priv->socket, g_object_unref);
+ g_object_ref (priv->socket),
+ g_object_unref);
}
/* Cache local and remote address */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]