]> OCCT Git - occt-copy.git/commitdiff
Correction to avoid crash by calling AddOrRemoveSelected for owner of AIS_ViewCubeFlat.
authornds <nds@opencascade.com>
Tue, 14 May 2019 11:31:43 +0000 (14:31 +0300)
committernds <nds@opencascade.com>
Tue, 14 May 2019 11:31:43 +0000 (14:31 +0300)
src/AIS/AIS_InteractiveContext_1.cxx

index 466deaca1ac79cfcd9ee40a20bd8da03b048fbb3..15b388d436806944f4a61cb69c2483dddd875faa 100644 (file)
@@ -957,7 +957,9 @@ void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(SelectMgr_EntityO
   {
     const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
     const Standard_Boolean isGlobal = anObj->GlobalSelOwner() == theOwner;
-    Handle(AIS_GlobalStatus)& aStatus = myObjects.ChangeFind (anObj);
+    if (!myObjects.IsBound(anObj)) // e.g. AIS_ViewCubeFlat is not displayed
+      return;
+   Handle(AIS_GlobalStatus)& aStatus = myObjects.ChangeFind (anObj);
     if (theOwner->IsSelected())
     {
       highlightSelected (theOwner);