From: jfa Date: Mon, 3 Oct 2005 13:01:36 +0000 (+0000) Subject: Provide correct static variable management to avoid problems, apperi... X-Git-Tag: ForTest_3_1_0a2~33 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5aed93b51831f39ee967c5dafa2d848b9a3b4114;p=modules%2Fsmesh.git Provide correct static variable management to avoid problems, appering if SMESHGUI is loaded from python script before module activation via GUI --- diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index d481b7d9c..17f9fdc9b 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -824,6 +824,7 @@ SalomeApp_Module( "SMESH" ) SMESHGUI::~SMESHGUI() { SMESH::GetFilterManager()->Destroy(); + SMESH::GetFilterManager() = SMESH::FilterManager::_nil(); } //============================================================================= diff --git a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx index c4ca04c37..8ea1769f9 100644 --- a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx @@ -1041,7 +1041,7 @@ void SMESHGUI_FilterLibraryDlg::onDeleteBtnPressed() tr("ERROR_OF_DELETING"), QMessageBox::Ok); } else { myCurrFilterName = ""; - myCurrFilterName = -1; + myCurrFilter = -1; myListBox->removeItem(anIndex); if (anIndex >= 1) diff --git a/src/SMESHGUI/SMESHGUI_FilterUtils.cxx b/src/SMESHGUI/SMESHGUI_FilterUtils.cxx index 360d00486..e5c529f16 100644 --- a/src/SMESHGUI/SMESHGUI_FilterUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterUtils.cxx @@ -22,13 +22,15 @@ #include "SMESHGUI.h" +#include "utilities.h" + namespace SMESH { - SMESH::FilterManager_var GetFilterManager() + SMESH::FilterManager_var& GetFilterManager() { static SMESH::FilterManager_var aFilterManager; - if (CORBA::is_nil(aFilterManager)){ - aFilterManager = SMESHGUI::GetSMESHGen()->CreateFilterManager(); + if (CORBA::is_nil(aFilterManager)) { + aFilterManager = SMESHGUI::GetSMESHGen()->CreateFilterManager(); } return aFilterManager; } diff --git a/src/SMESHGUI/SMESHGUI_FilterUtils.h b/src/SMESHGUI/SMESHGUI_FilterUtils.h index 85bd3d01a..6b8c75862 100644 --- a/src/SMESHGUI/SMESHGUI_FilterUtils.h +++ b/src/SMESHGUI/SMESHGUI_FilterUtils.h @@ -26,7 +26,7 @@ namespace SMESH{ - SMESH::FilterManager_var GetFilterManager(); + SMESH::FilterManager_var& GetFilterManager(); }