From 9b882768beb41c34d266c024d062cceb6464fee0 Mon Sep 17 00:00:00 2001 From: Zachary Lund Date: Thu, 2 Jan 2014 18:35:10 -0600 Subject: [PATCH] Fixed memory leak by calling gl_windowinfo_destroy in platform destruction. --- libobs-opengl/gl-x11.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libobs-opengl/gl-x11.c b/libobs-opengl/gl-x11.c index 7cd0c40ab..223641ae1 100644 --- a/libobs-opengl/gl-x11.c +++ b/libobs-opengl/gl-x11.c @@ -74,7 +74,6 @@ extern struct gl_windowinfo *gl_windowinfo_create(struct gs_init_data *info) extern void gl_windowinfo_destroy(struct gl_windowinfo *wi) { - blog(LOG_DEBUG, "%s called.", __FUNCTION__); bfree(wi); } @@ -91,7 +90,7 @@ extern void gl_getclientsize(struct gs_swap_chain *swap, static void print_info_stuff(struct gs_init_data *info) { - blog( LOG_DEBUG, + blog( LOG_INFO, "X and Y: %i %i\n" "Backbuffers: %i\n" "Color Format: %i\n" @@ -206,10 +205,13 @@ fail0: extern void gl_platform_destroy(struct gl_platform *platform) { - blog(LOG_DEBUG, "%s called.", __FUNCTION__); + if (!platform) + return; + glXMakeCurrent(platform->swap.wi->display, None, NULL); glXDestroyContext(platform->swap.wi->display, platform->context); XCloseDisplay(platform->swap.wi->display); + gl_windowinfo_destroy(platform->swap.wi); bfree(platform); } -- GitLab