为何occ 中new 都没有释放?
应该从 foundation class 寻求解答 occ 的内存管理机制
//tobe continued
from foundation class user guide p13
--------------------------------------------------------------------------------------------------------------------
In Open CASCADE, the Handles are specific classes that are used to safely
manipulate object allocated in the dynamic memory by reference, providing
reference counting mechanism and automatic destruction of the object when it is not
referenced
与java GC类似
--------------------------------------------------------------------------------------------------------------------
and p22
2.2.3 Using Handles to Create Objects
To create an object which is manipulated by handles, declare the handle and initialize
it with the standard C++ new operator, immediately followed by a call to the
constructor. The constructor can be any of those specified in the source of the class from
which the object is instanced.
following is the code
//Example Handle (Geom_CartesianPoint) p; p = new Geom_CartesianPoint(0,0,0);
Handle is not like the pointer, the delete operator does not work on a Handle; the referenced object
is automatically destroyed when no longer in use.