]> git.mxchange.org Git - flightgear.git/commitdiff
Ugly workaround for a crash on exit with multiple screens
authorMathias Froehlich <Mathias.Froehlich@web.de>
Sat, 1 Oct 2011 07:50:34 +0000 (09:50 +0200)
committerMathias Froehlich <Mathias.Froehlich@web.de>
Sat, 1 Oct 2011 07:50:34 +0000 (09:50 +0200)
src/GUI/new_gui.cxx

index 5d52b1c1dbb3b306e23b121ecd88a17497ee7661..ce4c7237d204c8d5a18d692a33e4929e62ea941d 100644 (file)
 
 #include <Main/fg_props.hxx>
 
+#ifndef _WIN32
+#include "GL/glx.h"
+#endif
+
 #include "menubar.hxx"
 #include "dialog.hxx"
 
@@ -417,6 +421,11 @@ FGFontCache::FGFontCache() :
 
 FGFontCache::~FGFontCache()
 {
+#ifndef _WIN32
+   // 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;