[gstreamer-bugs] [Bug 638914] New: Stopping and starting multiple time leaks resources

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Fri Jan 7 07:15:19 PST 2011

  GStreamer | gst-rtsp-server | git

           Summary: Stopping and starting multiple time leaks resources
    Classification: Desktop
           Product: GStreamer
           Version: git
        OS/Version: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-rtsp-server
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: jonas at hallerud.se
         QAContact: gstreamer-bugs at lists.sourceforge.net
      GNOME target: ---
     GNOME version: ---

In my setting I must be able to totally deinitialize the server when not in use
to conserve resources (embedded in Android app). Simply unreffing the server
doesn't help. It doesn't close it's listening socket, so when started the next
time the listening port is already in use. The server also has refs to
GIOChannel and GSource which are never unreffed from what I can see.

For now, I've added code close the listening socket and unref GIOChannel and
GSource in gst_rtsp_server_finalize. It seems to work, but I'm a glib noob, so
I could be horribly wrong.

The caller of gst_rtsp_server_attach is responsible for detaching the server
from its context. If not done, GIOChannel and GSource will be left with
ref_count 1.

My updated gst_rtsp_server_finalize:

static void
gst_rtsp_server_finalize (GObject * object)
  GstRTSPServer *server = GST_RTSP_SERVER (object);

  g_free (server->address);
  g_free (server->service);

  g_object_unref (server->session_pool);
  g_object_unref (server->media_mapping);

  if (server->io_watch)
    g_source_unref (server->io_watch);
  if (server->io_channel)
    g_io_channel_unref (server->io_channel);
  if (server->server_sock.fd >= 0)
    close (server->server_sock.fd);

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