From 7e52e727461f943a78fcc97e9b70d917930f07c4 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Wed, 15 Apr 2020 07:21:36 +0200 Subject: 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. --- video/out/opengl/context.c | 4 ++++ 1 file changed, 4 insertions(+) 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); } -- cgit v1.2.3