Again, how to write a cleanup function for a module in C

Lexy Zhitenev zhitenev at cs.vsu.ru
Sat Mar 29 04:30:04 EST 2003


"Alex Martelli" <aleax at aleax.it> wrote:
news:g8_ga.33370$i26.870013 at news2.tin.it...

>
> See standard Python library module atexit.
>
>
> Alex
>

Yes, Alex, but this method won't work if my program is killed by an
exception or by signal. The method that I use cleans things up on exception.

If I register a cleanup function in atexit while debugging, when most of
time my program terminates with an exception, my memory will leak
tremendously.

Possibly, there should be a PEP for that...






More information about the Python-list mailing list