int main(int argc, char** argv)
{
QApplicaiton app(argc, argv);
// parsing other arguments of argc,argv
return app.exec();
}
My problem is the following:
Function may be returned during parsing other arguments (without reaching app.exec()) and when QApplication object is deleted I am getting following error message QThread: Destroyed while thread is still running
. As a possible solution I am trying to create QApplication after argument parsing is done.
I have tried app.thread()->quit();
before return statement but it doesn't help.
When QApplication object is created it removes specific arguments (-style, etc.) from argc, argv.
Is it possible to get them from argc, argv manually without creating QApplication object?
It is weird that in a single threaded program I am getting QThread: Destroyed while thread is still running
error.
The best "solution" I have found so far is to create QApplication dynamically and not to delete it. The memory leak is not an issue because it is leaked just before program exits.