soup: Don't store a strong reference to the logging object
authorSebastian Dröge <sebastian@centricular.com>
Sat, 29 Jan 2022 10:56:22 +0000 (12:56 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Sat, 29 Jan 2022 16:22:48 +0000 (16:22 +0000)
Otherwise this causes a reference cycle between the session, the logger
and the logging object (i.e. the sink element or session wrapper).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1603>

subprojects/gst-plugins-good/ext/soup/gstsouputils.c

index d732c1a..4357cd2 100644 (file)
@@ -90,8 +90,7 @@ gst_soup_util_log_setup (SoupSession * session, SoupLoggerLogLevel level,
   /* Create a new logger and set body_size_limit to -1 (no limit) */
   logger = _soup_logger_new (level);
 
-  _soup_logger_set_printer (logger, gst_soup_util_log_printer_cb,
-      gst_object_ref (object), (GDestroyNotify) gst_object_unref);
+  _soup_logger_set_printer (logger, gst_soup_util_log_printer_cb, object, NULL);
 
   /* Attach logger to session */
   _soup_session_add_feature (session, (SoupSessionFeature *) logger);