According to https://doc.rust-lang.org/reference/behavior-not-considered-unsafe.html
drop() not being called, is ok~ish behaviour for rust.
So far I identified a few cases where this might happen:
The issue with this in the current pet project is handling device handles abstracted by a library that is not very good at releasing resources, so that has to be done explcitily.
panic!() case one can register another intermediate handler cleaning up the handle and forwarding to the original handler.
But for the generic case, how can I assure that a func is called after the
main is called? Coming from a C/C++ embedded background there exists some means of exit handlers (depening on the compiler).
How can I achieve the above with rust?
juice related issue
The more specific issue faces is described in https://github.com/spearow/juice/issues/88 but the above is the derived root question