Salome HOME
correct previous integration (Porting to Python 2.6)
[modules/kernel.git] / src / Utils / Utils_DESTRUCTEUR_GENERIQUE.cxx
index 61239063a4dac4dd4a80954eb95b55071c1008e5..18db18974912df64062f4be0ba89e9cede35a726 100644 (file)
@@ -1,32 +1,30 @@
-//  SALOME Utils : general SALOME's definitions and tools
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SALOME Utils : general SALOME's definitions and tools
 //  File   : Utils_DESTRUCTEUR_GENERIQUE.cxx
 //  Author : Antoine YESSAYAN, EDF
 //  Module : SALOME
 //  $Header$
-
-
+//
 # include <iostream>
 # include <list>
 extern "C"
@@ -36,12 +34,13 @@ extern "C"
 
 # include "Utils_DESTRUCTEUR_GENERIQUE.hxx"
 //# include "utilities.h"
+# include "LocalTraceBufferPool.hxx"
 void Nettoyage();
 
 #ifdef _DEBUG_
-static int MYDEBUG = 0;
+// static int MYDEBUG = 0;
 #else
-static int MYDEBUG = 0;
+// static int MYDEBUG = 0;
 #endif
 
 using namespace std;
@@ -83,6 +82,8 @@ public :
                DESTRUCTEUR_GENERIQUE_::Destructeurs = 
                       new std::list<DESTRUCTEUR_GENERIQUE_*> ; // Destructeur alloue dynamiquement (cf. ci-dessous) ,
                                                                   // il est utilise puis detruit par la fonction Nettoyage
+                //To be sure the trace singleton will be the last one to be destroyed initialize it here before calling atexit
+                LocalTraceBufferPool::instance();
                int cr = atexit( Nettoyage );                      // execute Nettoyage lors de exit, aprs la destruction des donnees statiques !
                assert(cr==0) ;
                ATEXIT_Done = true ;