Reading Basic use of Pointers indicates that when a NativeCall
C function returns pointer to an object with a class with repr('CPointer')
, it will call submethod DESTROY
where I can put my function to free the C memory. (This is fantastic and an amazing capability, btw.)
What if I get back a generic Pointer
, but later decide to nativecast()
it to the class? Will that also correctly DESTROY()
it when garbage collected? I think (and hope) it will, but haven't been able to prove that to myself.