factory: keep ref to factory while media active
authorWim Taymans <wim.taymans@collabora.co.uk>
Tue, 20 Nov 2012 11:29:55 +0000 (12:29 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 20 Nov 2012 11:29:55 +0000 (12:29 +0100)
While the media from a factory is alive, keep a ref to the factory.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=663555

gst/rtsp-server/rtsp-media-factory.c

index 1140e8b..29308c0 100644 (file)
@@ -653,8 +653,8 @@ gst_rtsp_media_factory_construct (GstRTSPMediaFactory * factory,
       if (!gst_rtsp_media_is_reusable (media)) {
         /* when not reusable, connect to the unprepare signal to remove the item
          * from our cache when it gets unprepared */
-        g_signal_connect (media, "unprepared", (GCallback) media_unprepared,
-            factory);
+        g_signal_connect_object (media, "unprepared",
+            (GCallback) media_unprepared, factory, 0);
       }
     }
   }