]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
macos: workaround faulty destructor
authorThomas Debesse <dev@illwieckz.net>
Mon, 21 Dec 2020 13:34:33 +0000 (14:34 +0100)
committerThomas Debesse <dev@illwieckz.net>
Tue, 22 Dec 2020 22:53:06 +0000 (23:53 +0100)
CMakeLists.txt
libs/gtkutil/xorrectangle.cpp
radiant/mainframe.cpp

index d4a31b5f374547dfc3fae5bca95526367a601c5a..3d78aa4798637c8569142ff466982ac1acd3885b 100644 (file)
@@ -202,6 +202,12 @@ if (BUILD_RADIANT)
             add_definitions(-DWORKAROUND_WINDOWS_GTK2_GLWIDGET=1)
         endif ()
     endif ()
+
+    if (APPLE)
+        if (GTK_TARGET EQUAL 2)
+            add_definitions(-DWORKAROUND_MACOS_GTK2_DESTROY=1)
+        endif ()
+    endif ()
 endif ()
 
 #-----------------------------------------------------------------------
index c638e0e21fcaa61ffd01d77da3f7ef32c5942d98..ab15ac88a730b3fa581e4f835a6141fd2c454cd6 100644 (file)
@@ -35,7 +35,9 @@ XORRectangle::XORRectangle(ui::GLArea widget) : m_widget(widget), cr(0)
 XORRectangle::~XORRectangle()
 {
     if (initialised()) {
+#ifndef WORKAROUND_MACOS_GTK2_DESTROY
         cairo_destroy(cr);
+#endif
     }
 }
 
index 8a7691af94b0d16d92cd740429f47d90e6b2c832..b43a55221f96caf832fabf56974373aba84b1736 100644 (file)
@@ -2775,10 +2775,14 @@ MainFrame::~MainFrame(){
 
        for ( std::vector<ui::Widget>::iterator i = g_floating_windows.begin(); i != g_floating_windows.end(); ++i )
        {
+#ifndef WORKAROUND_MACOS_GTK2_DESTROY
                i->destroy();
+#endif
        }
 
+#ifndef WORKAROUND_MACOS_GTK2_DESTROY
        m_window.destroy();
+#endif
 }
 
 void MainFrame::SetActiveXY( XYWnd* p ){