diff options
author | Niklas Haas <git@haasn.xyz> | 2017-09-21 15:51:47 +0200 |
---|---|---|
committer | Niklas Haas <git@haasn.xyz> | 2017-09-21 15:51:47 +0200 |
commit | aefd7a90c90bfcde90062a21b72e15d94b88e726 (patch) | |
tree | 35fc4843894f34ceb69debd1edbc231db13163a9 /video/out | |
parent | b9406917849748152c45b9347da1ef204970f59e (diff) | |
download | mpv-aefd7a90c90bfcde90062a21b72e15d94b88e726.tar.bz2 mpv-aefd7a90c90bfcde90062a21b72e15d94b88e726.tar.xz |
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)
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/opengl/context.c | 7 |
1 files changed, 5 insertions, 2 deletions
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; |