|
|
|
|
|
by twic
3611 days ago
|
|
There's a classic interview question about RAII along the lines of "in what situation can a RAII resource be acquired, but not released?". The key answer is "if someone turns the power off". 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. |
|
loop {}
^--- That'll also cause destructors to not be run.