X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_2smeshpy.cxx;fp=src%2FSMESH_I%2FSMESH_2smeshpy.cxx;h=dfacfd77c12ef2534e736e632807708aa6b1840f;hb=497561723ebe6ddc64d238427307dd59e6a5fb8b;hp=9a1f356fe93fcdc4f6d2b99d56eb14cab64b9a2f;hpb=65f809f88619175bd460ab55e8b5a9a5b22a63ff;p=modules%2Fsmesh.git diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index 9a1f356fe..dfacfd77c 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -3700,6 +3700,8 @@ _pyGroup::_pyGroup(const Handle(_pyCommand)& theCreationCmd, const _pyID & id) if ( !id.IsEmpty() ) setID( id ); + myCanClearCreationCmd = true; + const _AString& method = theCreationCmd->GetMethod(); if ( method == "CreateGroup" ) // CreateGroup() --> CreateEmptyGroup() { @@ -3742,6 +3744,12 @@ _pyGroup::_pyGroup(const Handle(_pyCommand)& theCreationCmd, const _pyID & id) } myFilter = filter; } + else + { + // theCreationCmd does something else apart from creation of this group + // and thus it can't be cleared if this group is removed + myCanClearCreationCmd = false; + } } //================================================================================ @@ -3829,9 +3837,9 @@ void _pyGroup::Process( const Handle(_pyCommand)& theCommand) void _pyGroup::Flush() { if ( !theGen->IsToKeepAllCommands() && - myCreationCmd && myCreationCmd->MethodStartsFrom("DoubleNode") ) + myCreationCmd && !myCanClearCreationCmd ) { - myCreationCmd.Nullify(); + myCreationCmd.Nullify(); // this way myCreationCmd won't be cleared } }