aasink: fix context initialisation and freeing to not leak

This commit is contained in:
Stefan Kost 2010-09-09 21:42:46 +03:00
parent b72c29a834
commit fbab577ab8

View file

@ -482,6 +482,7 @@ gst_aasink_get_property (GObject * object, guint prop_id, GValue * value,
static gboolean
gst_aasink_open (GstAASink * aasink)
{
if (!aasink->context) {
aa_recommendhidisplay (aa_drivers[aasink->aa_driver]->shortname);
aasink->context = aa_autoinit (&aasink->ascii_surf);
@ -492,7 +493,7 @@ gst_aasink_open (GstAASink * aasink)
}
aa_autoinitkbd (aasink->context, 0);
aa_resizehandler (aasink->context, (void *) aa_resize);
}
return TRUE;
}
@ -500,6 +501,7 @@ static gboolean
gst_aasink_close (GstAASink * aasink)
{
aa_close (aasink->context);
aasink->context = NULL;
return TRUE;
}