Cleanup code with Linux
I want to do proper cleanup before the linux application is closed by the user (SIGINT etc.).
So I have to catch these linux signals because Qt's event loop (QCoreApplication::exec) doesn't react on them.
I wanted to simply call QCoreApplication::quit() in the signal handler, but stop! quit() isn't documented as reentrant.
It works but it's not correct I guess because what if Qt is checking the event queue while SIGINT arrives and calls quit() which manipulates that event queue... race condition?
Ohh, I must have overlooked that.
It seems to be the solution, thanks!