summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorHui Jin <jhuix0117@gmail.com>2019-07-26 13:27:38 +0800
committerJames Ross-Gowan <rossy@jrg.systems>2019-09-14 21:35:49 +1000
commit191737b9c99e7ce3fa2796a5c4963eab73d7de13 (patch)
treeecd1dd33d216b0eb7ac83dfa4d1742ff7227ac16 /video
parent116ab73566b17e935d3f7371b18d03d13e5610ca (diff)
downloadmpv-191737b9c99e7ce3fa2796a5c4963eab73d7de13.tar.bz2
mpv-191737b9c99e7ce3fa2796a5c4963eab73d7de13.tar.xz
vo_d3d11/hwdec_dxva2dxgi: fix memory leak that 'ctx11' be not release
'ctx11' be not release when d3d11 hwdec be uninit with 'mapper_uninit' method.
Diffstat (limited to 'video')
-rw-r--r--video/out/d3d11/hwdec_dxva2dxgi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/video/out/d3d11/hwdec_dxva2dxgi.c b/video/out/d3d11/hwdec_dxva2dxgi.c
index 97471d02cb..8dbb1cf65d 100644
--- a/video/out/d3d11/hwdec_dxva2dxgi.c
+++ b/video/out/d3d11/hwdec_dxva2dxgi.c
@@ -148,7 +148,9 @@ static int mapper_init(struct ra_hwdec_mapper *mapper)
struct priv_owner *o = mapper->owner->priv;
struct priv *p = mapper->priv;
+ ID3D11Device_AddRef(o->dev11);
p->dev11 = o->dev11;
+ IDirect3DDevice9Ex_AddRef(o->dev9);
p->dev9 = o->dev9;
ID3D11Device_GetImmediateContext(o->dev11, &p->ctx11);
@@ -409,6 +411,10 @@ static void mapper_uninit(struct ra_hwdec_mapper *mapper)
for (int i = 0; i < p->queue_len; i++)
surf_destroy(mapper, p->queue[i]);
+
+ SAFE_RELEASE(p->ctx11);
+ SAFE_RELEASE(p->dev9);
+ SAFE_RELEASE(p->dev11);
}
static int mapper_map(struct ra_hwdec_mapper *mapper)