1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +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;

18
tests/bugs/vis/bug28093 Normal file
View File

@ -0,0 +1,18 @@
puts "==========="
puts "OCC28093"
puts "Visualization - access violation on removal of dynamic highlighting after device loss"
puts "==========="
puts ""
pload MODELING VISUALIZATION
box b 1 2 3
vclear
vinit View1
vdisplay -dispMode 1 -highMode 1 b
vfit
vmoveto 250 250
vraytrace 1
vmoveto 400 400
vdump $imagedir/${casename}.png