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:
parent
b940691784
commit
aefd7a90c9
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user