提交 c38a10da 编写于 作者: J jp9000

Fix memory leak in OSX test code

上级 d4ad1d5c
......@@ -17,7 +17,6 @@ const char *osx_desktop_test_getname(const char *locale)
static IOSurfaceRef current = NULL,
prev = NULL;
static texture_t tex = NULL;
static pthread_mutex_t c_mutex;
struct desktop_tex *osx_desktop_test_create(const char *settings,
......@@ -114,7 +113,7 @@ void osx_desktop_test_destroy(struct desktop_tex *rt)
}
if (rt->sampler)
samplerstate_destroy(rt->sampler);
if (tex)
if (rt->tex)
texture_destroy(rt->tex);
CGDisplayStreamStop(rt->disp);
effect_destroy(rt->whatever);
......@@ -136,7 +135,7 @@ void osx_desktop_test_video_render(struct desktop_tex *rt,
pthread_mutex_lock(&rt->mutex);
if (rt->prev != rt->current) {
if (tex)
if (rt->tex)
texture_rebind_iosurface(rt->tex, rt->current);
else
rt->tex = gs_create_texture_from_iosurface(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册