Commit 78db28b6 authored by Jean-Paul Saman's avatar Jean-Paul Saman

src/xvba_video_glx.c: Do not leak mutex and cleanup glx_surface_unref

glx_output_surface_destroy did not destroy a mutex created in glx_output_surface_create. Rewrite surface_unref.
parent 5287a61d
......@@ -803,8 +803,13 @@ glx_surface_unref(
object_glx_surface_p obj_glx_surface
)
{
if (obj_glx_surface && --obj_glx_surface->refcount == 0)
if (!obj_glx_surface)
return;
--obj_glx_surface->refcount;
if (obj_glx_surface->refcount == 0) {
destroy_glx_surface(driver_data, obj_glx_surface);
obj_glx_surface = NULL;
}
}
// References GLX surface
......@@ -1839,6 +1844,9 @@ glx_output_surface_destroy(
XFree(obj_output->gl_window.vi);
obj_output->gl_window.vi = NULL;
}
pthread_mutex_destroy(&obj_output->lock);
free(obj_output);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment