You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue was labelled with: in the Rust repository
I can't always guarantee that users are going to properly use a library (calling init methods, cleanup methods, etc.).
Occasionally things die horribly and you want to provide stronger guarantees about when things fail.
Is there a way to hook up to an exit signal of sorts to execute code when a program exits regardless of the exit mechanism? Something like Python atexit?
The text was updated successfully, but these errors were encountered:
@steveklabnik The link above to std::rt::at_exit is dead. Is there a modern alternative currently in existence for Rust 2018 edition? A colleague and I have run across the same need: we need to run some cleanup code when our (internal) library is not in use.
Issue by bmurphy1976
Tuesday Jan 21, 2014 at 01:54 GMT
For earlier discussion, see rust-lang/rust#11695
This issue was labelled with: in the Rust repository
I can't always guarantee that users are going to properly use a library (calling init methods, cleanup methods, etc.).
Occasionally things die horribly and you want to provide stronger guarantees about when things fail.
Is there a way to hook up to an exit signal of sorts to execute code when a program exits regardless of the exit mechanism? Something like Python atexit?
The text was updated successfully, but these errors were encountered: