Commit 7614ae53 authored by Hannes Domani's avatar Hannes Domani Committed by Jean-Baptiste Kempf

Direct3D: fix memory leak

Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
(cherry picked from commit 9ac30b31fc91e5a47135c1ca2f9c08ea0f5c255d)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent a15bef7c
...@@ -511,11 +511,9 @@ static HINSTANCE Direct3DLoadShaderLibrary(void) ...@@ -511,11 +511,9 @@ static HINSTANCE Direct3DLoadShaderLibrary(void)
{ {
HINSTANCE instance = NULL; HINSTANCE instance = NULL;
for (int i = 43; i > 23; --i) { for (int i = 43; i > 23; --i) {
char *filename = NULL; TCHAR filename[16];
if (asprintf(&filename, "D3dx9_%d.dll", i) == -1) _sntprintf(filename, 16, TEXT("D3dx9_%d.dll"), i);
continue; instance = LoadLibrary(filename);
instance = LoadLibrary(ToT(filename));
free(filename);
if (instance) if (instance)
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment