1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-03 14:10:33 +03:00

0028093: Visualization - access violation on removal of dynamic highlighting after device loss

OpenGl_Layer::Remove() now tries to remove object from myAlwaysRenderedMap
if it was not removed from other groups.
This commit is contained in:
kgv
2016-11-11 18:20:49 +03:00
committed by apn
parent 8022338566
commit ef9a9362ae
2 changed files with 30 additions and 8 deletions

View File

@@ -108,7 +108,18 @@ bool OpenGl_Layer::Remove (const OpenGl_Structure* theStruct,
if (!isForChangePriority)
{
if (theStruct->IsAlwaysRendered())
Standard_Boolean isAlwaysRend = theStruct->IsAlwaysRendered();
if (!isAlwaysRend)
{
if (!myBVHPrimitives.Remove (theStruct))
{
if (!myBVHPrimitivesTrsfPers.Remove (theStruct))
{
isAlwaysRend = Standard_True;
}
}
}
if (isAlwaysRend)
{
const Standard_Integer anIndex2 = myAlwaysRenderedMap.FindIndex (theStruct);
if (anIndex2 != 0)
@@ -117,13 +128,6 @@ bool OpenGl_Layer::Remove (const OpenGl_Structure* theStruct,
myAlwaysRenderedMap.RemoveLast();
}
}
else
{
if (!myBVHPrimitives.Remove (theStruct))
{
myBVHPrimitivesTrsfPers.Remove (theStruct);
}
}
}
--myNbStructures;
thePriority = aPriorityIter;