[Qt Message] exception on 3 [will close the socket handle - hack]
I got such an exception above. It seems the app will close the socket handle instead of closing by me.
I use the get() function of QNetworkAccessManager to get a url. and then deal with the data the url return.
- void MainWindow::on_cityComboBox_currentIndexChanged(int index)
- {
- ui->locaPlace->setText(localPlace);//add the place to the label-localPlace
- url.append(localPlace);
- }
I connect my Nokia 5230 to my computer and the app run on it.
It seems work well on it when my app is running.But when I close the app,the application output window come to such “[Qt Message] exception on 3 [will close the socket handle – hack]”
Any one meet such a problem? Any suggestion?
8 replies
Thanks for your reply.
How to close the socket?
I only use the QNetworkAccessManager and QNetworkReply of the network classes.
As said above,I only use the get() function of QNetworkAccessManager to get a url,and deal with the data that the url reply with the QNetworkReply.
and I don’t know how to locate the message,either because I don’t know how the problem appeared
How to close the socket?
Quote from Qt documentation:
Note: After the request has finished, it is the responsibility of the user to delete the QNetworkReply object at an appropriate time. Do not directly delete it inside the slot connected to finished(). You can use the deleteLater() function.
Maybe, QNetworkAccessManager also should be deleted on application close, I am not sure.
and I don’t know how to locate the message,either because I don’t know how the problem appeared
Just search all files in the Qt sources – it is Open Source benefit :-)
I’ve faced same problem. It looks like qt network access backend doesn’t handle sockets properly.
I suppose root cause is same as reported in:
http://bugreports.qt.nokia.com/browse/QTBUG-12686
You must log in to post a reply. Not a member yet? Register here!
