mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-26 00:58:12 +00:00
aasink: fix context initialisation and freeing to not leak
This commit is contained in:
parent
b72c29a834
commit
fbab577ab8
1 changed files with 11 additions and 9 deletions
|
@ -482,17 +482,18 @@ gst_aasink_get_property (GObject * object, guint prop_id, GValue * value,
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_aasink_open (GstAASink * aasink)
|
gst_aasink_open (GstAASink * aasink)
|
||||||
{
|
{
|
||||||
aa_recommendhidisplay (aa_drivers[aasink->aa_driver]->shortname);
|
if (!aasink->context) {
|
||||||
|
aa_recommendhidisplay (aa_drivers[aasink->aa_driver]->shortname);
|
||||||
|
|
||||||
aasink->context = aa_autoinit (&aasink->ascii_surf);
|
aasink->context = aa_autoinit (&aasink->ascii_surf);
|
||||||
if (aasink->context == NULL) {
|
if (aasink->context == NULL) {
|
||||||
GST_ELEMENT_ERROR (GST_ELEMENT (aasink), LIBRARY, TOO_LAZY, (NULL),
|
GST_ELEMENT_ERROR (GST_ELEMENT (aasink), LIBRARY, TOO_LAZY, (NULL),
|
||||||
("error opening aalib context"));
|
("error opening aalib context"));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
aa_autoinitkbd (aasink->context, 0);
|
||||||
|
aa_resizehandler (aasink->context, (void *) aa_resize);
|
||||||
}
|
}
|
||||||
aa_autoinitkbd (aasink->context, 0);
|
|
||||||
aa_resizehandler (aasink->context, (void *) aa_resize);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -500,6 +501,7 @@ static gboolean
|
||||||
gst_aasink_close (GstAASink * aasink)
|
gst_aasink_close (GstAASink * aasink)
|
||||||
{
|
{
|
||||||
aa_close (aasink->context);
|
aa_close (aasink->context);
|
||||||
|
aasink->context = NULL;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue