Generating report(thread-2)with floating window allowing user to cancel report(thread-3)if user decides to. When I press cancel button(thread-3) program ends but actually the report is still generating(thread-2). I get errors of trying to read closed files from thread-2. I have tried sending, receiving and stop threads. What am I doing wrong?