فهرست منبع

don't crash if gsg won't open

David Rose 23 سال پیش
والد
کامیت
00679ad733
1فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 3 2
      panda/src/dxgsg7/wdxGraphicsWindow7.cxx

+ 3 - 2
panda/src/dxgsg7/wdxGraphicsWindow7.cxx

@@ -167,13 +167,14 @@ make_gsg() {
 void wdxGraphicsWindow7::
 release_gsg() {
   if (_gsg != (GraphicsStateGuardian *)NULL) {
-    
     if (is_fullscreen()) {
       // Release the cooperative level we grabbed when we created the
       // GSG.
       DXScreenData *pScrn = &_dxgsg->scrn;
       nassertv(pScrn != (DXScreenData *)NULL);
-      pScrn->pDD->SetCooperativeLevel(_mwindow, DDSCL_NORMAL);
+      if (pScrn->pDD != (LPDIRECTDRAW7)NULL) {
+        pScrn->pDD->SetCooperativeLevel(_mwindow, DDSCL_NORMAL);
+      }
     }
 
     GraphicsWindow::release_gsg();