I use thread::spawn in the main thread to spawn a new thread that allocates some memory and does some work. Now I have the situation that the main thread might panic. As intended, the entire process ends and if I read the documentation correctly, any destructors should be called. But is this also true for the spawned thread if the panic is raised in the main thread?
Valgrind shows that there still is memory “possibly lost” and “still reachable”. Will this eventually be free’d? Do I need to do something to ensure that?