Firstly, before I get the main body, I've resurrected an ancient thread
that I seems to have reared its head again.
The problem is that __dealloc__ is not being called, this is despite, as
far as I can tell, no global references or circular dependencies.
The advice from earlier seems to be no longer relevant to my code base
(the original issue, annoyingly, seems to have not been version
controlled). I've picked it up where it made sense...
The code is well contained. The object that I wish __dealloc__ to be
called on at delete exists once in one file, the main module. When the
main module exits, __dealloc__ is not called.
The cython specific bit of the code is found here:
https://github.com/hgomersall/PicoPy/blob/master/picopy/pico3k.pyx
(specifically, the Pico3k class) there is nothing that instantiates such
an object anywhere in the package.
gc.garbage outside of the test function is an empty list.
The class represents a piece of hardware, with each class holding a
handle. As I said, the workaround I have implemented is a global list of
handles that is populated when the hardware is opened, with an
@atexit.register decorated method that iterates through the list to
close them all at exit.
I _think_ the problem is Windows specific (though I can't test it under
Linux at the moment due to the current hardware I have that the class
represents being Windows only).
Any insight would be much appreciated.
Cheers,
Henry