Cleanup code with Linux
Unsolved
General and Desktop
-
wrote on 16 Nov 2015, 08:14 last edited by
Hello,
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?Thank you!
-
Hi @qtacc32, this might help: http://doc.qt.io/qt-5/unix-signals.html
-
wrote on 18 Nov 2015, 12:11 last edited by
Ohh, I must have overlooked that.
It seems to be the solution, thanks!
1/3