From 41ef9490a8a1b77ed6e5e7441dad73982481ba85 Mon Sep 17 00:00:00 2001
From: Ruth Sabariego <ruth.sabariego@esat.kuleuven.be>
Date: Tue, 24 Jan 2012 13:51:38 +0000
Subject: [PATCH] temp fix

---
 Fltk/onelabWindow.cpp | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/Fltk/onelabWindow.cpp b/Fltk/onelabWindow.cpp
index efb68e42cd..4ce8da6991 100644
--- a/Fltk/onelabWindow.cpp
+++ b/Fltk/onelabWindow.cpp
@@ -273,12 +273,16 @@ bool onelab::localNetworkClient::run()
     case GmshSocket::GMSH_MERGE_FILE:
       {
         int n = PView::list.size();
-        for(int i = 0; i < n; i++)
-          PView::list[i]->getOptions()->visible = 0;
+        for(int i = 0; i < n; i++){
+          if(PView::list[i]->getData()->getFileName().substr(0, 6) != "OneLab")
+            PView::list[i]->getOptions()->visible = 0;
+        }
         MergeFile(message);
         if(FlGui::instance()->onelab->hideNewViews()){
-          for(int i = n; i < PView::list.size(); i++)
-            PView::list[i]->getOptions()->visible = 0;
+          for(int i = n; i < PView::list.size(); i++){
+            if(PView::list[i]->getData()->getFileName().substr(0, 6) != "OneLab")
+              PView::list[i]->getOptions()->visible = 0;
+          }
         }
         drawContext::global()->draw();
         if(n != (int)PView::list.size())
@@ -925,7 +929,8 @@ void onelabWindow::rebuildTree()
     but->copy_label(label.c_str());
     std::vector<Fl_Menu_Item> menu;
     for(unsigned int j = 0; j < strings[i].getChoices().size(); j++){
-      Fl_Menu_Item it = {strings[i].getChoices()[j].c_str(), 0, 0, 0,
+      // FIXME memory leak : change the way we construct the menu
+      Fl_Menu_Item it = {strdup(strings[i].getChoices()[j].c_str()), 0, 0, 0,
                          (strings[i].getKind() == "file" &&
                           j == strings[i].getChoices().size() - 1) ? FL_MENU_DIVIDER : 0};
       menu.push_back(it);
-- 
GitLab