Create d3d_device_free

This commit is contained in:
twinaphex 2016-01-07 00:19:27 +01:00
parent 4504c9fba1
commit 56a17b21f1
3 changed files with 16 additions and 4 deletions

View File

@ -502,3 +502,16 @@ bool d3d_reset(LPDIRECT3DDEVICE dev, D3DPRESENT_PARAMETERS *d3dpp)
return false;
}
void d3d_device_free(LPDIRECT3DDEVICE dev, LPDIRECT3D pd3d)
{
if (!dev)
return;
dev->Release();
if (!pd3d)
return;
pd3d->Release();
}

View File

@ -111,6 +111,8 @@ void d3d_set_render_state(void *data, D3DRENDERSTATETYPE state, DWORD value);
bool d3d_reset(LPDIRECT3DDEVICE dev, D3DPRESENT_PARAMETERS *d3dpp);
void d3d_device_free(LPDIRECT3DDEVICE dev, LPDIRECT3D pd3d);
#ifdef __cplusplus
}
#endif

View File

@ -834,10 +834,7 @@ static void d3d_free(void *data)
#endif
#endif
if (d3d->dev)
d3d->dev->Release();
if (d3d->g_pD3D)
d3d->g_pD3D->Release();
d3d_device_free(d3d->dev);
win32_monitor_from_window(window, true);