Please nominate your Qt Champions for 2021! https://forum.qt.io/topic/132134/looking-for-the-2021-qt-champions
SIGSEGV: CoreApplicationPrivate29sendThroughObjectEventFilters using std::exit(0)
franku last edited by
Hi all, I am trying to fix a problem in my QApplication which has to do something with the std::exit() function. The application is built an run on a openSuse Linux 12.1 with Qt 4.8.2 installed.
The application looks similar like this:
int main(int argc, char* argv)
atexit(cleanup); //external library code uses std::exit()
QApplication app(argc, argv);
MainWindow* win = MainWindowSingleton::instance();
//simulate a "library-exit"
bool test = true;
I cannot send all the code but the above shows mostly the layout of my program. It is linked against a larger library that uses the std::exit() function if any error occurs. But instead of exiting cleanly my application now raises a segmentation fault in this Qt Method: CoreApplicationPrivate29sendThroughObjectEventFiltersEP7QObject.
There is a singleton for my MainWindow that gets destroyed in the cleanup handler. When the application exits normally (bool test = false) then I have no problem. It only segfaults when running through the exit() handlers. Did many debugging attempts but with no effort.
I'd really have to be prepared for the std::exit() since the library has no alternative. Has someone experience when mixing the std:exit() with Qt code?