]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/new_gui.cxx
Some autopilot fixes
[flightgear.git] / src / GUI / new_gui.cxx
index 0e6346f0c709edfb8c32f7975665892221e4a432..220d4c3fcbb35579b3e4bbc4136ddf2354008e33 100644 (file)
 
 #include <Main/fg_props.hxx>
 
+#if defined(SG_UNIX) && !defined(SG_MAC) 
+#include "GL/glx.h"
+#endif
+
 #include "menubar.hxx"
 #include "dialog.hxx"
 
 extern puFont FONT_HELVETICA_14;
 extern puFont FONT_SANS_12B;
 
+using std::map;
+using std::string;
 
-
-\f
 ////////////////////////////////////////////////////////////////////////
 // Implementation of NewGUI.
 ////////////////////////////////////////////////////////////////////////
@@ -266,9 +270,6 @@ NewGUI::readDir (const SGPath& path)
           continue;
       }
       string name = nameprop->getStringValue();
-      if (_dialog_props[name])
-          delete (SGPropertyNode *)_dialog_props[name];
-
       _dialog_props[name] = props;
     }
 }
@@ -420,6 +421,11 @@ FGFontCache::FGFontCache() :
 
 FGFontCache::~FGFontCache()
 {
+#if defined(SG_UNIX) && !defined(SG_MAC) 
+   // Ugly workaround for a crash on exit with multiple screens configured
+   if (!glXGetCurrentContext())
+      return;
+#endif
    PuFontMap::iterator it, end = _puFonts.end();
    for (it = _puFonts.begin(); it != end; ++it)
        delete it->second;