|
|
|
|
|
by monocasa
3614 days ago
|
|
> Of course this is all hypotheticals and it could very well be argued that relying on destructors to do something actually critical would be a bad design. Eh, I'd only argue that in the case of garbage collected languages. In RAII languages like Rust and C++, it's the preferred way. |
|
panic_fmt entering an infinite loop leads to pretty similar results as someone turning the power off. The stack will not be unwound, destructors will not be run, and bad designs will leave external resources in an inconsistent state.