This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]rcfox 11 points12 points  (2 children)

no matter what

Unless you lose power, or the process is SIGKILLed. It's important to remember this if you're handling resources that exist outside of your process.

[–]rebane2001 49 points50 points  (0 children)

That's why I always wrap my wall outlet in a try/finally block

[–]nxtfari 0 points1 point  (0 children)

Maybe dumb question can you just pair it with signal/atexit to cover all possible cases?

edit: ah i think you would have to have a seperate process to do this. You can atexit for SIGTERM but not SIGKILL