No, garbage collection will only free up the memory, the OS will keep the file open until the process terminates.