From: Mathias Froehlich Date: Sat, 1 Oct 2011 07:50:34 +0000 (+0200) Subject: Ugly workaround for a crash on exit with multiple screens X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=978a577ea2091106b59b9d039571d96037707772;p=flightgear.git Ugly workaround for a crash on exit with multiple screens --- diff --git a/src/GUI/new_gui.cxx b/src/GUI/new_gui.cxx index 5d52b1c1d..ce4c7237d 100644 --- a/src/GUI/new_gui.cxx +++ b/src/GUI/new_gui.cxx @@ -22,6 +22,10 @@ #include
+#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;