提交 2a5899d1 编写于 作者: C computerquip

Merge pull request #16 from computerquip/master

Fixed memory leak by calling gl_windowinfo_destroy in platform destruction.
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册