From aefd7a90c90bfcde90062a21b72e15d94b88e726 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Thu, 21 Sep 2017 15:51:47 +0200 Subject: vo_gpu: fix memleak in ra_gl_ctx The ctx->ra was never freed propely, nor was p->wrapped_fb. (TIL: MPV_LEAK_REPORT exists) --- video/out/opengl/context.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'video') diff --git a/video/out/opengl/context.c b/video/out/opengl/context.c index d3cdcac3b7..6c8821f6c7 100644 --- a/video/out/opengl/context.c +++ b/video/out/opengl/context.c @@ -138,12 +138,15 @@ static void *get_native_display(void *priv, const char *name) void ra_gl_ctx_uninit(struct ra_ctx *ctx) { - if (ctx->ra) - ctx->ra->fns->destroy(ctx->ra); if (ctx->swapchain) { + struct priv *p = ctx->swapchain->priv; + if (ctx->ra && p->wrapped_fb) + ra_tex_free(ctx->ra, &p->wrapped_fb); talloc_free(ctx->swapchain); ctx->swapchain = NULL; } + + ra_free(&ctx->ra); } static const struct ra_swapchain_fns ra_gl_swapchain_fns; -- cgit v1.2.3