summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2020-06-21 20:09:59 +0200
committer hap <happppp@users.noreply.github.com>2020-06-21 20:10:18 +0200
commited4e373546857a03a11cb36f7a10aed4672f70ab (patch)
tree4b987098a6b9af69a11f2741079c9a7ed1640ff3 /src/osd
parenta09ab93312723acf33f0a364dc49c0558ab61116 (diff)
drawd3d: properly clean up d3dintf (nw)
Diffstat (limited to 'src/osd')
-rw-r--r--src/osd/modules/render/drawd3d.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/osd/modules/render/drawd3d.cpp b/src/osd/modules/render/drawd3d.cpp
index dab45177225..df1e31a0c25 100644
--- a/src/osd/modules/render/drawd3d.cpp
+++ b/src/osd/modules/render/drawd3d.cpp
@@ -209,6 +209,7 @@ bool renderer_d3d9::init(running_machine &machine)
d3d9_create_fn d3d9_create_ptr = d3dintf->d3d9_dll->bind<d3d9_create_fn>("Direct3DCreate9");
if (d3d9_create_ptr == nullptr)
{
+ global_free(d3dintf);
osd_printf_verbose("Direct3D: Unable to find Direct3D 9 runtime library\n");
return true;
}
@@ -216,6 +217,7 @@ bool renderer_d3d9::init(running_machine &machine)
d3dintf->d3dobj = (*d3d9_create_ptr)(D3D_SDK_VERSION);
if (d3dintf->d3dobj == nullptr)
{
+ global_free(d3dintf);
osd_printf_verbose("Direct3D: Unable to initialize Direct3D 9\n");
return true;
}
@@ -971,6 +973,7 @@ void renderer_d3d9::exit()
{
d3dintf->d3dobj->Release();
global_free(d3dintf);
+ d3dintf = nullptr;
}
}