mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
fixed a crash bug with a null pointer
This commit is contained in:
parent
553b9c6b20
commit
1ed5d5c0e3
@ -4855,6 +4855,7 @@ reset_d3d_device(D3DPRESENT_PARAMETERS *pPresParams, DXScreenData **pScrn) {
|
|||||||
|
|
||||||
get_engine()->reset_all_windows(true);// reset with new swapchains by creating
|
get_engine()->reset_all_windows(true);// reset with new swapchains by creating
|
||||||
|
|
||||||
|
if (pScrn)
|
||||||
*pScrn = NULL;
|
*pScrn = NULL;
|
||||||
if(pPresParams!=&_pScrn->PresParams)
|
if(pPresParams!=&_pScrn->PresParams)
|
||||||
memcpy(&_pScrn->PresParams,pPresParams,sizeof(D3DPRESENT_PARAMETERS));
|
memcpy(&_pScrn->PresParams,pPresParams,sizeof(D3DPRESENT_PARAMETERS));
|
||||||
@ -4862,7 +4863,7 @@ reset_d3d_device(D3DPRESENT_PARAMETERS *pPresParams, DXScreenData **pScrn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// release the old swapchain and create a new one
|
// release the old swapchain and create a new one
|
||||||
if (_pScrn->pSwapChain) {
|
if (_pScrn && _pScrn->pSwapChain) {
|
||||||
_pScrn->pSwapChain->Release();
|
_pScrn->pSwapChain->Release();
|
||||||
wdxdisplay8_cat.debug() << "SwapChain " << _pScrn->pSwapChain << " is released\n";
|
wdxdisplay8_cat.debug() << "SwapChain " << _pScrn->pSwapChain << " is released\n";
|
||||||
_pScrn->pSwapChain = NULL;
|
_pScrn->pSwapChain = NULL;
|
||||||
|
@ -4855,6 +4855,7 @@ reset_d3d_device(D3DPRESENT_PARAMETERS *pPresParams, DXScreenData **pScrn) {
|
|||||||
|
|
||||||
get_engine()->reset_all_windows(true);// reset with new swapchains by creating
|
get_engine()->reset_all_windows(true);// reset with new swapchains by creating
|
||||||
|
|
||||||
|
if (pScrn)
|
||||||
*pScrn = NULL;
|
*pScrn = NULL;
|
||||||
if(pPresParams!=&_pScrn->PresParams)
|
if(pPresParams!=&_pScrn->PresParams)
|
||||||
memcpy(&_pScrn->PresParams,pPresParams,sizeof(D3DPRESENT_PARAMETERS));
|
memcpy(&_pScrn->PresParams,pPresParams,sizeof(D3DPRESENT_PARAMETERS));
|
||||||
@ -4862,7 +4863,7 @@ reset_d3d_device(D3DPRESENT_PARAMETERS *pPresParams, DXScreenData **pScrn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// release the old swapchain and create a new one
|
// release the old swapchain and create a new one
|
||||||
if (_pScrn->pSwapChain) {
|
if (_pScrn && _pScrn->pSwapChain) {
|
||||||
_pScrn->pSwapChain->Release();
|
_pScrn->pSwapChain->Release();
|
||||||
wdxdisplay9_cat.debug() << "SwapChain " << _pScrn->pSwapChain << " is released\n";
|
wdxdisplay9_cat.debug() << "SwapChain " << _pScrn->pSwapChain << " is released\n";
|
||||||
_pScrn->pSwapChain = NULL;
|
_pScrn->pSwapChain = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user