Scripts hang if application is not closed
Description of Issue
When a python script starts or attaches to an application, without closing it later (e.g. with a fixture), it will never terminate.
The python interpreter runs waiting for a thread to be terminated.
If the script runs in release mode (without a debugger) the application will be locked, making it unresponsive and you have to kill it with a task manager or similar tool
Affected version(s)
1.0.0 (all?)
System information
- OS: all
- OS version: all
- Qt version: all
- Python version: all
Steps to reproduce
Run this script:
```python
import qat
qat.start_application(<any registered app>)
```
What is the current issue behavior?
The script never terminates unless qat.close_application() is called.
What is the expected behavior?
The script should terminate and the application should be closed automatically.
If qat.attach_to_application() was used, the script should terminate but the application should not be closed (attaching should not take ownership of the app).
Relevant logs and/or screenshots
Possible fixes
Make sure the thread of the TCP server is terminated, using asynchronous socket or other mechanism.
Can leverage the atexit module to detect script termination.
Also a qat.detach() function could be useful to let a started application run after the script is terminated.