From 6404704ee3898fa99027f89ac804df8f509b67c8 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 12 Jan 2023 22:51:49 +0100 Subject: [PATCH] x11display: Attempt to fix crash on shutdown with custom cursor --- panda/src/x11display/x11GraphicsWindow.cxx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/panda/src/x11display/x11GraphicsWindow.cxx b/panda/src/x11display/x11GraphicsWindow.cxx index c8ab5e1e9c..facb467f74 100644 --- a/panda/src/x11display/x11GraphicsWindow.cxx +++ b/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(); }