3 ms·
> It will be leaked if panic=unwind and if you use catch_panic. This isn't fully accurate. It is leaked if you use `panic=unwind` and the panic unwinds the fun
by fluffything 7y ago
> It will be leaked if panic=unwind and if you use catch_panic.
This isn't fully accurate. It is leaked if you use `panic=unwind` and the panic unwinds the function. At that point, the program is still running, but the memory is unreachable through a pointer in the program, and therefore leaked.
Whether you actually catch the panic afterwards doesn't matter. Not catching it will terminate the program, but then the program will be terminated with "leaked" memory, and tools like valgrind will report it as such.
- steveklabnik 7y ago(This comment is basically a duplicate of one of your other ones)