location of the bug


I trace the problem and have found it :
the problem is the AIS_Selection.
The AIS_Selection is referenced in AIS_Interactivecontext with myCurrentName and mySelectionName.

the Handle(AIS_Selection) object is stored in a static object ( static TColStd_SequenceOfTransient Selections; ) in AIS_Selection.cxx.

But the created AIS_Selection in a AIS_InteractiveContext is not destroyed. It means that the object is kept in the static sequence, till the programm terminates.

As written in AIS_Selection.cxx : "// beurk mais moins qu'avant.... rob". For me, it is very very "beurk".

So, you have to destroy the both Handle_AIS_Selection ( for myCurrentName and mySelectionName ) in the destructor of the AIS_InteractiveContext.

BTW, why the AIS_Selction objects are stored with TCollection_AsciiString in the context, and not directly with the handles ?
As soon as both AIS_Selection are only used in a context ( see the AIS_InteractiveContext::InitAttributes() where :
myCurrentName = AIS_Context_NewCurName();
mySelectionName = AIS_Context_NewSelName();


), you candirectly store the Handles and not the names !!!

Please, clean-up the code ( removing all the "beurk" things ( not the comments, but the ugly code )), and correct the problem ASAP.

fhchina's picture

Hi, Stephane:

I think you should register as a developer of OpenCascade, so you can directly modify these bugs. I have dived into some OCC codes, it's often ugly and stupid written.

BTW, I suspect if OpenCascade is truely Open Source, who is the developer outside the Matra?