[Bug 663944] souphttpsrc leaking file descriptors + memory when destroyed while connecting

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue Nov 15 15:12:52 PST 2011


https://bugzilla.gnome.org/show_bug.cgi?id=663944
  GStreamer | gst-plugins-good | git

--- Comment #1 from Dmitry Shatrov <erdizz at mail.ru> 2011-11-15 23:12:51 UTC ---
Created an attachment (id=201489)
 View: https://bugzilla.gnome.org/attachment.cgi?id=201489
 Review: https://bugzilla.gnome.org/review?bug=663944&attachment=201489

libsoup resource leak fix

This is a fix for releasing resources allocated by libsoup when pipeline goes
to NULL state. It only works correctly with a patch to libsoup which I have
sent to libsoup mailing list. Here's the libsoup patch:

diff -ur libsoup/libsoup/soup-socket.c libsoup_new/libsoup/soup-socket.c
--- libsoup/libsoup/soup-socket.c    2011-11-12 16:57:51.000000000 +0400
+++ libsoup_new/libsoup/soup-socket.c    2011-11-16 02:22:13.583630395 +0400
@@ -679,9 +679,6 @@
     GSocketConnection *conn;
     guint status;

-    if (priv->async_context && !priv->use_thread_context)
-        g_main_context_pop_thread_default (priv->async_context);
-
     conn = g_socket_client_connect_finish (G_SOCKET_CLIENT (client),
                            result, &error);
     status = socket_connected (sacd->sock, conn, error);
@@ -736,6 +733,10 @@
                        priv->connect_cancel,
                        async_connected, sacd);
     g_object_unref (client);
+
+    if (priv->async_context && !priv->use_thread_context)
+        g_main_context_pop_thread_default (priv->async_context);
+
 }

 /**
@@ -1057,9 +1058,6 @@
     GError *error = NULL;
     guint status;

-    if (priv->async_context && !priv->use_thread_context)
-        g_main_context_pop_thread_default (priv->async_context);
-
     if (g_tls_connection_handshake_finish (G_TLS_CONNECTION (priv->conn),
                            result, &error))
         status = SOUP_STATUS_OK;
@@ -1093,10 +1091,14 @@

     if (priv->async_context && !priv->use_thread_context)
         g_main_context_push_thread_default (priv->async_context);
+
     g_tls_connection_handshake_async (G_TLS_CONNECTION (priv->conn),
                       G_PRIORITY_DEFAULT,
                       cancellable, handshake_async_ready,
                       data);
+
+    if (priv->async_context && !priv->use_thread_context)
+        g_main_context_pop_thread_default (priv->async_context);
 }

 /**

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list