summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-01-28 01:12:34 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-01-28 01:12:34 +0200
commit42244dd2a46ff0e14c6192fa7d8fdb01d033befa (patch)
tree0508d7379d53163cdb5552e151532ae3e95f60c9 /libvo
parentc710c5ee504530eeb7ef7c73f6665fdb291dd206 (diff)
downloadmpv-42244dd2a46ff0e14c6192fa7d8fdb01d033befa.tar.bz2
mpv-42244dd2a46ff0e14c6192fa7d8fdb01d033befa.tar.xz
x11_common: always free x11 context struct on exit
Previously it was not freed if no X11 display had been opened (for example -vo null).
Diffstat (limited to 'libvo')
-rw-r--r--libvo/x11_common.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/libvo/x11_common.c b/libvo/x11_common.c
index b6ab203a6a..85ba55cc3f 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -520,14 +520,13 @@ void vo_uninit(struct vo_x11_state *x11)
{
mp_msg(MSGT_VO, MSGL_V,
"vo: x11 uninit called but X11 not initialized..\n");
- return;
+ } else {
+ mp_msg(MSGT_VO, MSGL_V, "vo: uninit ...\n");
+ XSetErrorHandler(NULL);
+ XCloseDisplay(x11->display);
+ x11->depthonscreen = 0;
+ x11->display = NULL;
}
-// if( !vo_depthonscreen ) return;
- mp_msg(MSGT_VO, MSGL_V, "vo: uninit ...\n");
- XSetErrorHandler(NULL);
- XCloseDisplay(x11->display);
- x11->depthonscreen = 0;
- x11->display = NULL;
talloc_free(x11);
}