1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +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

@@ -1454,8 +1454,10 @@ Handle(SelectMgr_EntityOwner) AIS_LocalContext::FindSelectedOwnerFromShape(const
Standard_Boolean found(Standard_False);
if (!found) {
NCollection_List<Handle(SelectBasics_EntityOwner)>::Iterator anOwnersIt (myMainVS->ActiveOwners());
for (; anOwnersIt.More(); anOwnersIt.Next()) {
NCollection_List<Handle(SelectBasics_EntityOwner)> anActiveOwners;
myMainVS->ActiveOwners (anActiveOwners);
for (NCollection_List<Handle(SelectBasics_EntityOwner)>::Iterator anOwnersIt (anActiveOwners); anOwnersIt.More(); anOwnersIt.Next())
{
EO = Handle(SelectMgr_EntityOwner)::DownCast (anOwnersIt.Value());
Handle(StdSelect_BRepOwner) BROwnr = Handle(StdSelect_BRepOwner)::DownCast(EO);
if (!BROwnr.IsNull() && BROwnr->HasShape() && BROwnr->Shape() == sh) {