When you call Thrd.Free, the following code is run from TThread.Destroy:
Terminate;
if FCreateSuspended then
Resume;
WaitFor;
A call Freein the stream will thus interrupt the stream synchronously.
I guess the call WaitFornever returns. Perhaps it TCaptureThread.Executedoes not check Terminatedand does not exit. Perhaps TCaptureThreadwaiting in the main thread, and therefore waiting in the dead ends of the thread.
It is very difficult to do anything other than guessing based on your question, but I would like to check if your code passed after the call WaitForupon destruction Thrd. Turn on Debug DCU, set a breakpoint on the call, WaitForand see for yourself.
source
share