1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-20 18:28:01 +00:00

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)
This commit is contained in:
Niklas Haas 2017-09-21 15:51:47 +02:00
parent b940691784
commit aefd7a90c9
No known key found for this signature in database
GPG Key ID: 9A09076581B27402

View File

@ -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;