I was reading libstdc++-v3 std::thread implementation and I saw that a unique_ptr is released after the thread is created, so when it runs out of scope, the memory that is potentially used by the new thread isn't deallocated. (https://github.com/gcc-mirror/gcc/blob/6b1633378b74bed1d999a0ae2549088515a30ba0/libstdc%2B%2B-v3/src/c%2B%2B11/thread.cc#L152). As far as I'm concerned, one must manually delete the manual pointer later, but I can't find where that is done. Help?