-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Approaches to get a destructor when main
finishes.
#62
Comments
Rust as a language has basically made the design decision to not have custom user code running before or after However, the crate could provide something like |
One possible workaround you could do is to have the lazy_static be of a |
For synchronization I'm quite sure to resort to |
It's been a while now, so I'll go ahead and close this issue as a design decision we inherit from Rust upstream. Please feel free to re-open though if there's anything more you'd like to add! |
FYI this affects crate |
documentation notes static declared instances may leak (like with lazy_static). Links to underlying reason rust-lang-nursery/lazy-static.rs#62 Issue #183
Hi, I have a problem that I wish I could rely somehow on destruction of
lazy_static
to call drop on what's inside it. I know it might be impossible, but I guess it's worth asking. Suggestions for workaround etc. are welcome. I was eg. thinking about using aWeak
insidelazy_static
, but then I do have to have a strong reference somewhere in the main thread.The text was updated successfully, but these errors were encountered: