Hi Author,
One thing I noticed from your code is that you are creating a handle to the shape when you call the constructor:
Handle(AIS_Shape) myShapeHandle = new AIS_Shape(myTopoDS_Shape);
whereas because you are storing the handle in a class, I would have expected to see:
m_myShapeHandle = new AIS_Shape(myTopoDS_Shape)
and a appropriate member declared in the header for your class:
Handle(AIS_Shape) m_myShapeHandle;
Is it possible that you have two handles pointing at the same AIS_Shape, so the reference counter is increased by 1? Although in this case, I would have expected the reference counter to increase to 4 when you display the shape, so I doubt this is the problem.
Sorry if this is a stupid suggestion.
Regards,
Commenter-1