From 7ec6dc0bded3714be904d12896f6c92c67aa0978 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 4 Jan 2017 09:44:08 +0100 Subject: [PATCH] (x_ctx.c) Cleanup --- gfx/drivers_context/x_ctx.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/gfx/drivers_context/x_ctx.c b/gfx/drivers_context/x_ctx.c index 644c0cc38d..cc1f9b2902 100644 --- a/gfx/drivers_context/x_ctx.c +++ b/gfx/drivers_context/x_ctx.c @@ -153,17 +153,19 @@ static void gfx_ctx_x_destroy_resources(gfx_ctx_x_data_t *x) x11_colormap_destroy(); - if (x->g_should_reset_mode && g_x11_dpy) + if (g_x11_dpy) { - x11_exit_fullscreen(g_x11_dpy, &x->g_desktop_mode); - x->g_should_reset_mode = false; - } + if (x->g_should_reset_mode) + { + x11_exit_fullscreen(g_x11_dpy, &x->g_desktop_mode); + x->g_should_reset_mode = false; + } - if (!video_driver_is_video_cache_context() - && g_x11_dpy) - { - XCloseDisplay(g_x11_dpy); - g_x11_dpy = NULL; + if (!video_driver_is_video_cache_context()) + { + XCloseDisplay(g_x11_dpy); + g_x11_dpy = NULL; + } } g_pglSwapInterval = NULL;