Archived issue #0024141
Draw Harness, ViewerTest - AIS_InteractiveContext should be explicitly cleared before removal
Description
After removing of viewer and interactive context (AIS_InteractiveContext), existing interactive objects still holds handle of Graphic3d_GraphicDriver which also leads to re-computation errors like this:
Or memory corruption inside OpenGl_GraphicDriver (which should be destroyed but has left in invalid state by back references).
> AIS_TexturedShape::Compute() in ShadingMode failed
Or memory corruption inside OpenGl_GraphicDriver (which should be destroyed but has left in invalid state by back references).
Steps to reproduce
Test case for current master (using shared OpenGL resources to expose OpenGl_GraphicDriver internal issues):
pload MODELING pload VISUALIZATION box b 1 2 3 vinit drv1/v1/v1 vdisplay b vfit vtexture b 3 vinit drv2/v1/v1 vdisplay b vtexture b 4 vfit vclose drv1/v1/v1 vinit drv1/v1/v1 vdisplay b vtexture b 5 vfit
Public activity
1 archived note
Participants are labeled by their role within this record.
The code now has proper NULL-check protections, however OpenGl_GraphicDriver is still alive when closing the last view - the only way to destroy it is to create new driver and clear context.
vinit drv2/v1/v1 vclear
Related records
- #0024047 · related to · closedException in TPrsStd_AISPresentation during destruction of TDocStd_Document
- #0027957 · related to · closedVisualization, AIS_InteractiveContext - protect from displaying the same AIS_InteractiveObject within multiple contexts
- #0032456 · related to · newDraw Harness, ViewerTest - map of interactive objects GetMapOfAIS() should be bound to active AIS_InteractiveContext
- #0023117 · child of · closedTKV3d and TKOpenGl code clean-up