Hi,
Added a thread termination control in case of main frame OnClose.
Ignore previous two patches !
Best regards,Vladimir Kokovic, DP senior, Belgrade, Serbia