Salome HOME
Fix EDF #15107 - SIGSEGV because object browser is not created
authorCédric Aguerre <cedric.aguerre@edf.fr>
Tue, 11 Jul 2017 16:43:39 +0000 (18:43 +0200)
committerCédric Aguerre <cedric.aguerre@edf.fr>
Tue, 11 Jul 2017 16:43:39 +0000 (18:43 +0200)
src/MEDCalc/gui/MEDModule.cxx

index 8a613447850d24cbc4b91a7bac4d89c2b7e63694..9e59a5979ef3e8e29a8b105658f5f7e5252e9b28 100644 (file)
@@ -62,6 +62,7 @@ MEDModule::MEDModule() :
   _datasourceController(0), _workspaceController(0), _presentationController(0),
   _processingController(0), _pvGuiElements(0)
 {
+  STDLOG("MEDModule::MEDModule()");
   // Note also that we can't use the getApp() function here because
   // the initialize(...) function has not been called yet.
 
@@ -122,9 +123,13 @@ MEDModule::init()
 void
 MEDModule::initialize( CAM_Application* app )
 {
+  STDLOG("MEDModule::initialize()");
   // call the parent implementation
   SalomeApp_Module::initialize( app );
 
+  if (! getApp()->objectBrowser())
+    getApp()->getWindow(SalomeApp_Application::WT_ObjectBrowser);
+
   getApp()->objectBrowser()->setAutoOpenLevel(5);
 
   if (app && app->desktop()) {
@@ -160,6 +165,7 @@ MEDModule::iconName() const
 void
 MEDModule::windows( QMap<int, int>& theMap ) const
 {
+  STDLOG("MEDModule::windows()");
   // want Object browser, in the left area
   theMap.insert( SalomeApp_Application::WT_ObjectBrowser,
                  Qt::LeftDockWidgetArea );
@@ -199,6 +205,7 @@ MEDModule::createPreferences()
 bool
 MEDModule::activateModule( SUIT_Study* theStudy )
 {
+  STDLOG("MEDModule::activateModule()");
   if ( CORBA::is_nil( _MED_engine ) )
     return false;
 
@@ -228,6 +235,7 @@ MEDModule::activateModule( SUIT_Study* theStudy )
 bool
 MEDModule::deactivateModule( SUIT_Study* theStudy )
 {
+  STDLOG("MEDModule::deactivateModule()");
   _workspaceController->showDockWidgets(false);
   _presentationController->showDockWidgets(false);
   //this->unsetDockLayout();