fixed a crash bug with a null pointer

This commit is contained in:
Asad M. Zaman 2004-03-19 17:30:17 +00:00
parent 553b9c6b20
commit 1ed5d5c0e3
2 changed files with 6 additions and 4 deletions

View File

@ -4855,14 +4855,15 @@ reset_d3d_device(D3DPRESENT_PARAMETERS *pPresParams, DXScreenData **pScrn) {
get_engine()->reset_all_windows(true);// reset with new swapchains by creating
*pScrn = NULL;
if (pScrn)
*pScrn = NULL;
if(pPresParams!=&_pScrn->PresParams)
memcpy(&_pScrn->PresParams,pPresParams,sizeof(D3DPRESENT_PARAMETERS));
return hr;
}
// release the old swapchain and create a new one
if (_pScrn->pSwapChain) {
if (_pScrn && _pScrn->pSwapChain) {
_pScrn->pSwapChain->Release();
wdxdisplay8_cat.debug() << "SwapChain " << _pScrn->pSwapChain << " is released\n";
_pScrn->pSwapChain = NULL;

View File

@ -4855,14 +4855,15 @@ reset_d3d_device(D3DPRESENT_PARAMETERS *pPresParams, DXScreenData **pScrn) {
get_engine()->reset_all_windows(true);// reset with new swapchains by creating
*pScrn = NULL;
if (pScrn)
*pScrn = NULL;
if(pPresParams!=&_pScrn->PresParams)
memcpy(&_pScrn->PresParams,pPresParams,sizeof(D3DPRESENT_PARAMETERS));
return hr;
}
// release the old swapchain and create a new one
if (_pScrn->pSwapChain) {
if (_pScrn && _pScrn->pSwapChain) {
_pScrn->pSwapChain->Release();
wdxdisplay9_cat.debug() << "SwapChain " << _pScrn->pSwapChain << " is released\n";
_pScrn->pSwapChain = NULL;