server: ensure the watch has a ref to the server

This commit is contained in:
Wim Taymans 2011-01-12 18:26:57 +01:00
parent 3315031bf6
commit 94c9999715

View file

@ -775,6 +775,7 @@ static void
watch_destroyed (GstRTSPServer * server)
{
GST_DEBUG_OBJECT (server, "source destroyed");
g_object_unref (server);
}
/**
@ -805,7 +806,7 @@ gst_rtsp_server_create_watch (GstRTSPServer * server)
/* configure the callback */
g_source_set_callback (source,
(GSourceFunc) gst_rtsp_server_io_func, server,
(GSourceFunc) gst_rtsp_server_io_func, g_object_ref (server),
(GDestroyNotify) watch_destroyed);
return source;