summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2020-04-15 07:21:36 +0200
committerNiklas Haas <git@haasn.xyz>2020-04-15 07:21:36 +0200
commit7e52e727461f943a78fcc97e9b70d917930f07c4 (patch)
tree7bef7dd492473f6a99f5068a2040627f3d2c67e1
parentd669c67149856df261abcc142f8b07f3af2b3f46 (diff)
downloadmpv-7e52e727461f943a78fcc97e9b70d917930f07c4.tar.bz2
mpv-7e52e727461f943a78fcc97e9b70d917930f07c4.tar.xz
vo_gpu: opengl: make sure to always clean up debug callbacks
In theory this mostly happens automatically, especially after the 5 vsync limit disables this already. But if we uninit before 5 vsyncs are rendered, this can get left in a dangling 'enabled' state, which leaks a debug report callback. Always explicitly disable it just to be on the safe side.
-rw-r--r--video/out/opengl/context.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/video/out/opengl/context.c b/video/out/opengl/context.c
index 781352da34..c491039b66 100644
--- a/video/out/opengl/context.c
+++ b/video/out/opengl/context.c
@@ -135,6 +135,10 @@ void ra_gl_ctx_uninit(struct ra_ctx *ctx)
ctx->swapchain = NULL;
}
+ // Clean up any potentially left-over debug callback
+ if (ctx->ra)
+ ra_gl_set_debug(ctx->ra, false);
+
ra_free(&ctx->ra);
}