ext/cdio/gstcdiocddasrc.c: Make sure we always destroy our libcdio handle.

Original commit message from CVS:
* ext/cdio/gstcdiocddasrc.c: (gst_cdio_cdda_src_open),
(gst_cdio_cdda_src_finalize):
Make sure we always destroy our libcdio handle.
This commit is contained in:
Jan Schmidt 2007-03-04 17:13:19 +00:00
parent 5114bbb5c2
commit d5706e78aa
2 changed files with 16 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2007-03-04 Jan Schmidt <thaytan@mad.scientist.com>
* ext/cdio/gstcdiocddasrc.c: (gst_cdio_cdda_src_open),
(gst_cdio_cdda_src_finalize):
Make sure we always destroy our libcdio handle.
2007-03-04 Jan Schmidt <thaytan@mad.scientist.com> 2007-03-04 Jan Schmidt <thaytan@mad.scientist.com>
* tests/check/Makefile.am: * tests/check/Makefile.am:

View file

@ -287,6 +287,9 @@ not_audio:
{ {
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
(_("Disc is not an Audio CD.")), ("discmode: %d", (gint) discmode)); (_("Disc is not an Audio CD.")), ("discmode: %d", (gint) discmode));
cdio_destroy (src->cdio);
src->cdio = NULL;
return FALSE; return FALSE;
} }
} }
@ -312,6 +315,13 @@ gst_cdio_cdda_src_init (GstCdioCddaSrc * src, GstCdioCddaSrcClass * klass)
static void static void
gst_cdio_cdda_src_finalize (GObject * obj) gst_cdio_cdda_src_finalize (GObject * obj)
{ {
GstCdioCddaSrc *src = GST_CDIO_CDDA_SRC (obj);
if (src->cdio) {
cdio_destroy (src->cdio);
src->cdio = NULL;
}
G_OBJECT_CLASS (parent_class)->finalize (obj); G_OBJECT_CLASS (parent_class)->finalize (obj);
} }