About the Handle ???

---------------------------------------------------
TopoDS_Shape aShape = ...;
Handle(AIS_Shape) m_hShape = new AIS_Shape(aShape);
---------------------------------------------------
In my instance, the aShape will be updated ceaselessly and hence the m_hShape also needs to be updated. I am wondering if it is necessary to delete m_hShape prior to assigning a new value to m_hShape ?

Paul Jimenez's picture

Just use the method Set of AIS_Shape to set a new shape. You may need to call Redisplay(m_hShape) on the InteractiveContext after that.

arkoala's picture

You don't need to delete that pointer.
Handle variables are managed by OCC similar to pointers in Java (Garbaje collector). If no one references the variable, memory is released

Jun WANG's picture

I get it. Thanks a lot.