Browse Source

Destroy swapchain before removing the window info

This fixes an issue reported by valgrind where cleaning up the
swapchain fails because the window info is destroyed before.
fryshorts 11 years ago
parent
commit
944c2dc9f7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      libobs-opengl/gl-x11.c

+ 1 - 1
libobs-opengl/gl-x11.c

@@ -276,9 +276,9 @@ void gl_platform_destroy(struct gl_platform *platform)
 	Display *dpy = platform->swap.wi->display;
 	Display *dpy = platform->swap.wi->display;
 
 
 	glXMakeCurrent(dpy, None, NULL);
 	glXMakeCurrent(dpy, None, NULL);
+	gl_platform_cleanup_swapchain(&platform->swap);
 	glXDestroyContext(dpy, platform->context);
 	glXDestroyContext(dpy, platform->context);
 	gl_windowinfo_destroy(platform->swap.wi);
 	gl_windowinfo_destroy(platform->swap.wi);
-	gl_platform_cleanup_swapchain(&platform->swap);
 	bfree(platform);
 	bfree(platform);
 }
 }