mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-30 22:20:34 +05:00
Fix bug 12109: SIGSEGV after trying to create sub-mesh in the second study.
This commit is contained in:
parent
a636c1e101
commit
39e3ed0090
@ -67,11 +67,7 @@ SMESHGUI_SelectionOp::SMESHGUI_SelectionOp( const Selection_Mode mode )
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
SMESHGUI_SelectionOp::~SMESHGUI_SelectionOp()
|
SMESHGUI_SelectionOp::~SMESHGUI_SelectionOp()
|
||||||
{
|
{
|
||||||
Filters::const_iterator anIt = myFilters.begin(),
|
removeCustomFilters();
|
||||||
aLast = myFilters.end();
|
|
||||||
for( ; anIt!=aLast; anIt++ )
|
|
||||||
if( anIt.data() )
|
|
||||||
delete anIt.data();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -99,17 +95,21 @@ void SMESHGUI_SelectionOp::startOperation()
|
|||||||
// name : removeCustomFilters
|
// name : removeCustomFilters
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_SelectionOp::removeCustomFilters() const
|
void SMESHGUI_SelectionOp::removeCustomFilters()
|
||||||
{
|
{
|
||||||
|
if (myFilters.count() > 0) {
|
||||||
LightApp_SelectionMgr* mgr = selectionMgr();
|
LightApp_SelectionMgr* mgr = selectionMgr();
|
||||||
if( !mgr )
|
|
||||||
return;
|
|
||||||
|
|
||||||
Filters::const_iterator anIt = myFilters.begin(),
|
Filters::const_iterator anIt = myFilters.begin(),
|
||||||
aLast = myFilters.end();
|
aLast = myFilters.end();
|
||||||
for( ; anIt!=aLast; anIt++ )
|
for (; anIt != aLast; anIt++) {
|
||||||
if( anIt.data() )
|
if (anIt.data()) {
|
||||||
mgr->removeFilter( anIt.data() );
|
if (mgr) mgr->removeFilter(anIt.data());
|
||||||
|
delete anIt.data();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
myFilters.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -195,9 +195,7 @@ void SMESHGUI_SelectionOp::onActivateObject( int id )
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_SelectionOp::onDeactivateObject( int id )
|
void SMESHGUI_SelectionOp::onDeactivateObject( int id )
|
||||||
{
|
{
|
||||||
LightApp_SelectionMgr* mgr = selectionMgr();
|
removeCustomFilters();
|
||||||
if( mgr && myFilters.contains( id ) && myFilters[ id ] )
|
|
||||||
mgr->removeFilter( myFilters[ id ] );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
|
@ -90,7 +90,7 @@ protected:
|
|||||||
virtual SUIT_SelectionFilter* createFilter( const int ) const;
|
virtual SUIT_SelectionFilter* createFilter( const int ) const;
|
||||||
|
|
||||||
//! Remove only filters set by this operation (they are in map myFilters )
|
//! Remove only filters set by this operation (they are in map myFilters )
|
||||||
void removeCustomFilters() const;
|
void removeCustomFilters();
|
||||||
|
|
||||||
//! Return what selection mode is set in VTK viewer
|
//! Return what selection mode is set in VTK viewer
|
||||||
Selection_Mode selectionMode() const;
|
Selection_Mode selectionMode() const;
|
||||||
|
Loading…
Reference in New Issue
Block a user