1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0026324: Visualization - fix iteration through corrupted memory in AIS_LocalContext::FindSelectedOwnerFromShape

The signature of SelectMgr_ViewerSelector::ActiveOwners is changed to return output parameter to avoid crash
This commit is contained in:
vpa
2015-06-08 17:52:17 +03:00
committed by bugmaster
parent c3ec36b69f
commit 751955d4d7
3 changed files with 7 additions and 8 deletions

View File

@@ -839,9 +839,8 @@ const Handle(SelectBasics_SensitiveEntity)& SelectMgr_ViewerSelector::DetectedEn
// function : ActiveOwners
// purpose : Returns the list of active entity owners
//=======================================================================
NCollection_List<Handle(SelectBasics_EntityOwner)> SelectMgr_ViewerSelector::ActiveOwners() const
void SelectMgr_ViewerSelector::ActiveOwners (NCollection_List<Handle(SelectBasics_EntityOwner)>& theOwners) const
{
NCollection_List<Handle(SelectBasics_EntityOwner)> anActiveOwners;
for (SelectMgr_MapOfObjectSensitivesIterator anIter (myMapOfObjectSensitives); anIter.More(); anIter.Next())
{
const NCollection_Handle<SelectMgr_SensitiveEntitySet>& anEntitySet = anIter.Value();
@@ -850,10 +849,8 @@ NCollection_List<Handle(SelectBasics_EntityOwner)> SelectMgr_ViewerSelector::Act
{
if (anEntitySet->GetSensitiveById (anIdx)->IsActiveForSelection())
{
anActiveOwners.Append (anEntitySet->GetSensitiveById (anIdx)->BaseSensitive()->OwnerId());
theOwners.Append (anEntitySet->GetSensitiveById (anIdx)->BaseSensitive()->OwnerId());
}
}
}
return anActiveOwners;
}