> Can C extended python modules provide any kind module destructor, so 
> that whenever the module is unloaded some cleanup is run?


I've needed the same thing before but couldn't find it. AFAIK, the best 
you can do is register an exit function that will be called when python 
exits. Here is a sample code snippet:

//Called when python exits
void CleanupModule(void)
{
     //Perform cleanup here
}


Then in your init<module> function add the following code:

//Register function to be called when python exits
Py_AtExit(CleanupModule);

-Farshid
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to