Selaa lähdekoodia

fix crash on shutdown

David Rose 17 vuotta sitten
vanhempi
sitoutus
e52bf51058
1 muutettua tiedostoa jossa 8 lisäystä ja 0 poistoa
  1. 8 0
      panda/src/tinydisplay/tinyXGraphicsWindow.cxx

+ 8 - 0
panda/src/tinydisplay/tinyXGraphicsWindow.cxx

@@ -150,6 +150,10 @@ bool TinyXGraphicsWindow::
 begin_frame(FrameMode mode, Thread *current_thread) {
 begin_frame(FrameMode mode, Thread *current_thread) {
   PStatTimer timer(_make_current_pcollector, current_thread);
   PStatTimer timer(_make_current_pcollector, current_thread);
 
 
+  if (_xwindow == (Window)NULL) {
+    return false;
+  }
+
   begin_frame_spam(mode);
   begin_frame_spam(mode);
   if (_gsg == (GraphicsStateGuardian *)NULL) {
   if (_gsg == (GraphicsStateGuardian *)NULL) {
     return false;
     return false;
@@ -218,6 +222,10 @@ end_frame(FrameMode mode, Thread *current_thread) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void TinyXGraphicsWindow::
 void TinyXGraphicsWindow::
 begin_flip() {
 begin_flip() {
+  if (_xwindow == (Window)NULL) {
+    return;
+  }
+
   if (_reduced_frame_buffer != (ZBuffer *)NULL) {
   if (_reduced_frame_buffer != (ZBuffer *)NULL) {
     // Zoom the reduced buffer onto the full buffer.
     // Zoom the reduced buffer onto the full buffer.
     ZB_zoomFrameBuffer(_full_frame_buffer, 0, 0, 
     ZB_zoomFrameBuffer(_full_frame_buffer, 0, 0,