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

0024047: Exception in TPrsStd_AISPresentation during destruction of TDocStd_Document

Adding test case for this fix
Modification in order to avoid exception during destruction of AIS_InteractiveContext
Small modification for trihedron
Small modifications to avoid regressions
Cosmetic modification
This commit is contained in:
gka
2013-07-18 13:16:35 +04:00
parent efef9da8e5
commit da0e82aac3
7 changed files with 109 additions and 7 deletions

View File

@@ -199,6 +199,16 @@ void AIS_InteractiveContext::Delete() const
// be performed when mgrSelector will be destroyed but anyway...
mgrSelector->Remove( myMainSel );
#endif
AIS_ListOfInteractive aList;
AIS_DataMapIteratorOfDataMapOfIOStatus anIt(myObjects);
Handle(AIS_InteractiveContext) aNullContext;
for(; anIt.More() ; anIt.Next())
{
Handle(AIS_InteractiveObject) anObj = anIt.Key();
anObj->SetContext(aNullContext);
}
MMgt_TShared::Delete();
}

View File

@@ -155,6 +155,8 @@ Handle(AIS_InteractiveContext) AIS_InteractiveObject::GetContext() const
void AIS_InteractiveObject::SetContext(const Handle(AIS_InteractiveContext)& aCtx)
{
myCTXPtr = aCtx.operator->();
if( aCtx.IsNull())
return;
if (myDrawer.IsNull()) {
myDrawer = new AIS_Drawer;
#ifdef DEB

View File

@@ -638,9 +638,20 @@ void AIS_Trihedron::LoadSubObjects()
void AIS_Trihedron::SetContext(const Handle(AIS_InteractiveContext)& Ctx)
{
// Standard_Boolean same_DA = myDrawer->Link() == Ctx->DefaultDrawer();
if( Ctx.IsNull())
{
Standard_Integer anIdx;
for (anIdx = 0; anIdx < 7; anIdx++)
{
myShapes[anIdx]->SetContext(Ctx);
}
AIS_InteractiveObject::SetContext (Ctx);
return;
}
// Remove subobjects from current context
Handle(AIS_InteractiveContext) anAISContext = GetContext();
Standard_Boolean hasContext = (anAISContext.IsNull() == Standard_False);
Standard_Integer anIdx;
for (anIdx = 0; anIdx < 7; anIdx++)
@@ -655,9 +666,8 @@ void AIS_Trihedron::SetContext(const Handle(AIS_InteractiveContext)& Ctx)
}
myShapes[anIdx].Nullify();
}
AIS_InteractiveObject::SetContext (Ctx);
LoadSubObjects();
for(Standard_Integer i= 0;i<=6;i++)
myShapes[i]->SetContext (Ctx);