On Monday, 22 January 2018 at 16:37:19 UTC, Andres Clari wrote:
All threads withing a process share the same heap, so whatever one thread allocated in that heap is not freed or reclaimed automatically when thread dies, it stays in the heap.

Well the destructor of some Json objects and strings should be called when the thread exits tho.

If some objects were on the stack of the thread proc, their destructors run, yes, as usual for leaving a scope. Strings don't have destructors, afaik. Thread-local storage gets cleaned up too. But everything that lives in heap, stays there, until GC finds them. Objects in heap don't have any information on them which thread they belong to.

Reply via email to