From 5be5185d17cdfe89152c2a8f44f728d9f250b9fb Mon Sep 17 00:00:00 2001 From: SoftFever Date: Tue, 24 Mar 2026 20:39:45 +0800 Subject: [PATCH] Remove OSX 10.9.5 crash workaround (dead code with wxWidgets 3.3+) wxWidgets 3.3 requires macOS 10.11+, making the 10.9.5-specific crash workaround in OpenGLManager impossible to trigger. Remove: - OSInfo struct and s_os_info static member from the header - OS version recording in init_glcontext() - Conditional wxGLContext deletion in the destructor (now always deletes) - Unused #include The MacDarkMode.hpp include is retained as mac_max_scaling_factor() is still used by GLInfo::get_max_tex_size(). --- src/slic3r/GUI/OpenGLManager.cpp | 27 ++------------------------- src/slic3r/GUI/OpenGLManager.hpp | 14 -------------- 2 files changed, 2 insertions(+), 39 deletions(-) diff --git a/src/slic3r/GUI/OpenGLManager.cpp b/src/slic3r/GUI/OpenGLManager.cpp index 17c372a59f..a585bdac96 100644 --- a/src/slic3r/GUI/OpenGLManager.cpp +++ b/src/slic3r/GUI/OpenGLManager.cpp @@ -19,9 +19,6 @@ #include "GUI_Init.hpp" #ifdef __APPLE__ -// Part of hack to remove crash when closing the application on OSX 10.9.5 when building against newer wxWidgets -#include - #include "../Utils/MacDarkMode.hpp" #endif // __APPLE__ @@ -237,26 +234,12 @@ bool OpenGLManager::s_force_power_of_two_textures = false; OpenGLManager::EMultisampleState OpenGLManager::s_multisample = OpenGLManager::EMultisampleState::Unknown; OpenGLManager::EFramebufferType OpenGLManager::s_framebuffers_type = OpenGLManager::EFramebufferType::Unknown; -#ifdef __APPLE__ -// Part of hack to remove crash when closing the application on OSX 10.9.5 when building against newer wxWidgets -OpenGLManager::OSInfo OpenGLManager::s_os_info; -#endif // __APPLE__ - OpenGLManager::~OpenGLManager() { m_shaders_manager.shutdown(); -#ifdef __APPLE__ - // This is an ugly hack needed to solve the crash happening when closing the application on OSX 10.9.5 with newer wxWidgets - // The crash is triggered inside wxGLContext destructor - if (s_os_info.major != 10 || s_os_info.minor != 9 || s_os_info.micro != 5) - { -#endif //__APPLE__ - if (m_context != nullptr) - delete m_context; -#ifdef __APPLE__ - } -#endif //__APPLE__ + if (m_context != nullptr) + delete m_context; } bool OpenGLManager::init_gl(bool popup_error) @@ -412,12 +395,6 @@ wxGLContext* OpenGLManager::init_glcontext(wxGLCanvas& canvas, const std::pair