mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-03-01 11:15:37 +05:00
21948: EDF SMESH : Memory is not freed when deleting a mesh
SMESH::RemoveVisualObjectWithActors() at object removal from study
This commit is contained in:
parent
91312a2db5
commit
cad015ecdc
@ -357,12 +357,10 @@
|
|||||||
|
|
||||||
anEntryList.append( aMeshSO->GetID().c_str() );
|
anEntryList.append( aMeshSO->GetID().c_str() );
|
||||||
|
|
||||||
#ifdef WITHGENERICOBJ
|
|
||||||
// obj has been published in study. Its refcount has been incremented.
|
// obj has been published in study. Its refcount has been incremented.
|
||||||
// It is safe to decrement its refcount
|
// It is safe to decrement its refcount
|
||||||
// so that it will be destroyed when the entry in study will be removed
|
// so that it will be destroyed when the entry in study will be removed
|
||||||
aMeshes[i]->UnRegister();
|
aMeshes[i]->UnRegister();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
isEmpty = true;
|
isEmpty = true;
|
||||||
@ -1812,22 +1810,23 @@
|
|||||||
std::string anEntry = SO->GetID();
|
std::string anEntry = SO->GetID();
|
||||||
|
|
||||||
/** Erase graphical object **/
|
/** Erase graphical object **/
|
||||||
if(SO->FindAttribute(anAttr, "AttributeIOR")){
|
if(SO->FindAttribute(anAttr, "AttributeIOR")) {
|
||||||
ViewManagerList aViewMenegers = anApp->viewManagers();
|
SMESH::RemoveVisualObjectWithActors( anEntry.c_str(), true);
|
||||||
ViewManagerList::const_iterator it = aViewMenegers.begin();
|
// ViewManagerList aViewMenegers = anApp->viewManagers();
|
||||||
for( ; it != aViewMenegers.end(); it++) {
|
// ViewManagerList::const_iterator it = aViewMenegers.begin();
|
||||||
SUIT_ViewManager* vm = *it;
|
// for( ; it != aViewMenegers.end(); it++) {
|
||||||
int nbSf = vm ? vm->getViewsCount() : 0;
|
// SUIT_ViewManager* vm = *it;
|
||||||
if(vm) {
|
// int nbSf = vm ? vm->getViewsCount() : 0;
|
||||||
QVector<SUIT_ViewWindow*> aViews = vm->getViews();
|
// if(vm) {
|
||||||
for(int i = 0; i < nbSf; i++){
|
// QVector<SUIT_ViewWindow*> aViews = vm->getViews();
|
||||||
SUIT_ViewWindow *sf = aViews[i];
|
// for(int i = 0; i < nbSf; i++){
|
||||||
if(SMESH_Actor* anActor = SMESH::FindActorByEntry(sf,anEntry.c_str())){
|
// SUIT_ViewWindow *sf = aViews[i];
|
||||||
SMESH::RemoveActor(sf,anActor);
|
// if(SMESH_Actor* anActor = SMESH::FindActorByEntry(sf,anEntry.c_str())){
|
||||||
}
|
// SMESH::RemoveActor(sf,anActor);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
/** Remove an object from data structures **/
|
/** Remove an object from data structures **/
|
||||||
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( SO ));
|
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( SO ));
|
||||||
@ -1926,10 +1925,6 @@ SalomeApp_Module( "SMESH" )
|
|||||||
myEventCallbackCommand->SetCallback( SMESHGUI::ProcessEvents );
|
myEventCallbackCommand->SetCallback( SMESHGUI::ProcessEvents );
|
||||||
myPriority = 0.0;
|
myPriority = 0.0;
|
||||||
|
|
||||||
SMESH::GetFilterManager();
|
|
||||||
SMESH::GetPattern();
|
|
||||||
SMESH::GetMeasurements();
|
|
||||||
|
|
||||||
/* load resources for all available meshers */
|
/* load resources for all available meshers */
|
||||||
SMESH::InitAvailableHypotheses();
|
SMESH::InitAvailableHypotheses();
|
||||||
}
|
}
|
||||||
@ -1941,12 +1936,6 @@ SalomeApp_Module( "SMESH" )
|
|||||||
//=============================================================================
|
//=============================================================================
|
||||||
SMESHGUI::~SMESHGUI()
|
SMESHGUI::~SMESHGUI()
|
||||||
{
|
{
|
||||||
#ifdef WITHGENERICOBJ
|
|
||||||
SMESH::GetFilterManager()->UnRegister();
|
|
||||||
SMESH::GetMeasurements()->UnRegister();
|
|
||||||
#endif
|
|
||||||
SMESH::GetFilterManager() = SMESH::FilterManager::_nil();
|
|
||||||
SMESH::GetMeasurements() = SMESH::Measurements::_nil();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
Loading…
Reference in New Issue
Block a user