process stays in memory after application closes
Hello all
i have simple application that start QDialog from its main like this :
- int main(int argc, char *argv[])
- {
- Q_INIT_RESOURCE(resources);
- app.setStyle("WindowsXP");
- AuthenticationDialogContainer *pAuthenticationDialogContainer = new AuthenticationDialogContainer();
- return 0;
- }
- return app.exec();
- }
when its pass the end of the application that is after app.exec() and the application doing what is suppose to do . when i open the windows xp task manager i see that the process is still in memory and i need manually kill it . how can i prevent it from happening ?
10 replies
Your main windows should have a close button at the top right (typically a red button with cross). If you press this button the window will be closed and the application stopped.
Otherwise you may have another button in your dialog window. You have to connect a signal (presumably clicked() ) to the quit slot of your QCoreApplication / QApplication.
Assuming that you may create a quit signal in your container:
int main(int argc, char *argv[]) { Q_INIT_RESOURCE(resources); app.setStyle("WindowsXP"); AuthenticationDialogContainer *pAuthenticationDialogContainer = new uthenticationDialogContainer(); bool boo = connect ( pAuthenticationDialogContainer, SIGNAL ( quit() ), &app, SLOT ( quit () ) ); assert ( boo ); return 0; } return app.exec(); }
You must log in to post a reply. Not a member yet? Register here!




