I'm having problems with the function Remove() of an Interactive Context. In my application I create a new AIS_Shape using the new operator and storing it for later use in a Handle(AIS_Shape). After that the refernce counter of the handle is 1. After displaying the object in my AIS_InteractiveContext using the Display() function the reference counter is increased to 3. After some operations I want to free the allocated memory for the AIS_Shape object again. This is done I think using the Remove function. Then I force the release of the handle by calling the Nullify() function of the Handle(AIS_Shape), which first decrements the reference counter by one and then checks whether the counter is 0. But it is not 0, during debugging I found that calling Remove() decreases the reference counter only by 1 from 3 to 2, so that the later call of Nullify results in a reference counter of 1. Because of this the memory is not released. It seems to me that somehow the Interactice Context still owns a reference to my handle.
So my questions is am I doing somthing wrong, or is there any other way to force the release of memory of an interactive object.
Thanks for your help,