From 323219508ad7d5f90286f4b1f05919d941a8f7c8 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Tue, 20 Nov 2012 09:22:00 +0000
Subject: [PATCH] make sure we don't call instance() during FlGui constructor

---
 Fltk/graphicWindow.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Fltk/graphicWindow.cpp b/Fltk/graphicWindow.cpp
index 3f037dab97..66897a6ae8 100644
--- a/Fltk/graphicWindow.cpp
+++ b/Fltk/graphicWindow.cpp
@@ -2671,7 +2671,8 @@ class mainWindowSpecialResize : public mainWindow {
     : mainWindow(w, h, nonModal, l) {}
   virtual void resize(int X,int Y,int W,int H)
   {
-    bool special = (shown() && this == FlGui::instance()->graph[0]->getWindow());
+    bool special = (FlGui::available() && shown() && 
+		    this == FlGui::instance()->graph[0]->getWindow());
     int old_mh = 0;
     if(special)
       old_mh = FlGui::instance()->graph[0]->getMessageHeight();
-- 
GitLab