Provide correct static variable <aFilterManager> management to avoid problems, appering if SMESHGUI is loaded from python script before module activation via GUI

This commit is contained in:
jfa 2005-10-03 13:01:36 +00:00
parent b22f47d357
commit 5aed93b518
4 changed files with 8 additions and 5 deletions

View File

@ -824,6 +824,7 @@ SalomeApp_Module( "SMESH" )
SMESHGUI::~SMESHGUI()
{
SMESH::GetFilterManager()->Destroy();
SMESH::GetFilterManager() = SMESH::FilterManager::_nil();
}
//=============================================================================

View File

@ -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)

View File

@ -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;
}

View File

@ -26,7 +26,7 @@
namespace SMESH{
SMESH::FilterManager_var GetFilterManager();
SMESH::FilterManager_var& GetFilterManager();
}