From c978ab757ab62b295e65936858758fdf7e67b6bc Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Mon, 21 Aug 2023 12:56:55 -0500 Subject: [PATCH 2/2] connection-auth: don't crash if connection outlives the auth Currently we crash if the SoupConnection lives longer than the SoupConnectionAuth. I'm unsure whether this is intended to happen, but since it does happen, we should probably disconnect from the SoupConnection's signal rather than crash when it does. Probably fixes #348 --- libsoup/auth/soup-connection-auth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libsoup/auth/soup-connection-auth.c b/libsoup/auth/soup-connection-auth.c index 2d9514f9..34d40d12 100644 --- a/libsoup/auth/soup-connection-auth.c +++ b/libsoup/auth/soup-connection-auth.c @@ -113,8 +113,8 @@ soup_connection_auth_get_connection_state_for_message (SoupConnectionAuth *auth, g_hash_table_insert (priv->conns, conn, state); g_mutex_unlock (&priv->lock); if (conn) { - g_signal_connect (conn, "disconnected", - G_CALLBACK (connection_disconnected), auth); + g_signal_connect_object (conn, "disconnected", + G_CALLBACK (connection_disconnected), auth, 0); } } else { g_mutex_unlock (&priv->lock); -- 2.41.0