That is right; you will be a resource leak if you do not attach and disconnect the stream.
Each thread will allocate some memory for its stack and probably some control structures, and this memory will not be freed. On some operating systems, there is a limit on the number of threads that you can run, and you can end up with a state in which you can no longer run.
source share