{using Qt 4.7.0, Windows Xp, Visual Studio 2005}
hi, i've develope a Qt console project to implement a protocol which is up and running on the intended product for quite sometime now. But recently a problem has come up. The application is never meant to shutdown so there is nothing to quit it from inside the application. What it does is it implements a new thread for each client connection on the developed protocol and when the client disconnects, it ends the thread and continues polling for new connections, which is all fine. Now when the tester runs it in debug mode the console window pops up showing the logs of the ongoing activities. The problem is when this console window is manually closed it gives an error "the instruction at 0xwhatever referenced memory at 0xwhatever which could not be read. Click Ok to terminate". I've identified this problem and it comes because one of the shutdown functions is not called.
How do i call this custom shutdown function whenever the application is closed in such a way? (by the way, if one "ends process" in the task manager this problem does not pop up and that's why the release mode shutdowns are always fine as they don't pop up a console window and only way to do is is through task manager)
p.s: i have tried using QCoreApplication's aboutToQuit() signal to call a custom slot which calls the shutdown functions indicated above. This does not seem to work. I don't know if the signal is fired up in such application shutdown events.
Bookmarks