Make it possible to manually set one of the devices with d3d_device_free

This commit is contained in:
twinaphex 2016-01-07 02:22:53 +01:00
parent 8b9c6d099f
commit e8656333f1
2 changed files with 7 additions and 11 deletions

View File

@ -505,13 +505,8 @@ bool d3d_reset(LPDIRECT3DDEVICE dev, D3DPRESENT_PARAMETERS *d3dpp)
void d3d_device_free(LPDIRECT3DDEVICE dev, LPDIRECT3D pd3d)
{
if (!dev)
return;
dev->Release();
if (!pd3d)
return;
pd3d->Release();
if (dev)
dev->Release();
if (pd3d)
pd3d->Release();
}

View File

@ -388,7 +388,7 @@ static bool d3d_initialize(d3d_video_t *d3d, const video_info_t *info)
if (!d3d_reset(d3d->dev, &d3dpp))
{
d3d_deinitialize(d3d);
g_pD3D->Release();
d3d_device_free(NULL, g_pD3D);
g_pD3D = NULL;
ret = d3d_init_base(d3d, info);
@ -847,7 +847,8 @@ static void d3d_free(void *data)
#endif
d3d_device_free(d3d->dev, g_pD3D);
g_pD3D = NULL;
d3d->dev = NULL;
g_pD3D = NULL;
win32_monitor_from_window(window, true);