yeah, there's no guarantee that __del__ will get executed, it's an issue with the object refs.
Other interesting avenue worth to explore can be atexit.register()