summaryrefslogtreecommitdiffstats
path: root/video/out/vo_opengl_cb.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-22 12:45:43 +0100
committerwm4 <wm4@nowhere>2014-12-22 12:45:43 +0100
commit16a5971d28ae3ac72a9e38b00d73162ec24d56a9 (patch)
treee28220dca3ba376eb438065f514f2e5c49e8af42 /video/out/vo_opengl_cb.c
parentc640b8f3c030927580aa1cb4fd30f2b68a5ccd63 (diff)
downloadmpv-16a5971d28ae3ac72a9e38b00d73162ec24d56a9.tar.bz2
mpv-16a5971d28ae3ac72a9e38b00d73162ec24d56a9.tar.xz
vo_opengl_cb: free context on exit
Minor memory leak. Actually, this also exposes some problems in the QtQuick example. This will have to be fixed in the example.
Diffstat (limited to 'video/out/vo_opengl_cb.c')
-rw-r--r--video/out/vo_opengl_cb.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/video/out/vo_opengl_cb.c b/video/out/vo_opengl_cb.c
index a6731c6a51..363b6a333f 100644
--- a/video/out/vo_opengl_cb.c
+++ b/video/out/vo_opengl_cb.c
@@ -79,10 +79,18 @@ struct mpv_opengl_cb_context {
struct vo *active;
};
+static void free_ctx(void *ptr)
+{
+ mpv_opengl_cb_context *ctx = ptr;
+
+ pthread_mutex_destroy(&ctx->lock);
+}
+
struct mpv_opengl_cb_context *mp_opengl_create(struct mpv_global *g,
struct osd_state *osd)
{
mpv_opengl_cb_context *ctx = talloc_zero(NULL, mpv_opengl_cb_context);
+ talloc_set_destructor(ctx, free_ctx);
ctx->log = mp_log_new(ctx, g->log, "opengl-cb");
pthread_mutex_init(&ctx->lock, NULL);