From: mpv Date: Fri, 23 May 2014 08:55:50 +0000 (+0400) Subject: Fix crash on remove X-Git-Tag: V_0.2~16^2^2~2^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1c8693aec4ed843c3200346fe8cc0f2d541a26ae;p=modules%2Fshaper.git Fix crash on remove --- diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index e8f481409..6343d8b7b 100644 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -196,6 +196,11 @@ void Model_Document::startOperation() void Model_Document::finishOperation() { + // just to be sure that everybody knows that changes were performed + Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_FEATURE_CREATED)); + Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_FEATURE_UPDATED)); + Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_FEATURE_DELETED)); + if (myNestedNum != -1) // this nested transaction is owervritten myNestedNum++; if (!myDoc->HasOpenCommand()) { @@ -376,8 +381,9 @@ static int RemoveFromRefArray( Handle(TDataStd_ReferenceArray) aRefs; if (theArrayLab.FindAttribute(TDataStd_ReferenceArray::GetID(), aRefs)) { if (aRefs->Length() == 1) { // just erase an array - if ((theIndex == -1 && aRefs->Value(0) == theReferenced) || theIndex == 0) + if ((theIndex == -1 && aRefs->Value(0) == theReferenced) || theIndex == 0) { theArrayLab.ForgetAttribute(TDataStd_ReferenceArray::GetID()); + } aResult = 0; } else { // reduce the array Handle(TDataStd_HLabelArray1) aNewArray = @@ -391,7 +397,7 @@ static int RemoveFromRefArray( aNewArray->SetValue(aCount, aRefs->Value(a)); } } - aRefs->SetInternalArray(aNewArray); + aRefs->SetInternalArray(aNewArray); } } return aResult;