Browse Source

x11display: Attempt to fix crash on shutdown with custom cursor

rdb 2 years ago
parent
commit
6404704ee3
1 changed files with 4 additions and 6 deletions
  1. 4 6
      panda/src/x11display/x11GraphicsWindow.cxx

+ 4 - 6
panda/src/x11display/x11GraphicsWindow.cxx

@@ -130,12 +130,6 @@ x11GraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe,
  */
 x11GraphicsWindow::
 ~x11GraphicsWindow() {
-  if (!_cursor_filenames.empty()) {
-    LightReMutexHolder holder(x11GraphicsPipe::_x_mutex);
-    for (auto item : _cursor_filenames) {
-      XFreeCursor(_display, item.second);
-    }
-  }
 }
 
 /**
@@ -1031,6 +1025,10 @@ close_window() {
     _orig_size_id = -1;
   }
 
+  for (auto item : _cursor_filenames) {
+    XFreeCursor(_display, item.second);
+  }
+
   GraphicsWindow::close_window();
 }