DiscussionsIssue archiveOther usage issues

Archived discussion

About the Handle ???

Other usage issuesTue, 01/20/2009 - 09:333 replies

Browse this forum
QuestionAuthor

---------------------------------------------------
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 ?

Discussion

3 archived replies

Posts are displayed in their archived order.

01Commenter-1

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.

02Commenter-2

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

03Author

I get it. Thanks a lot.