[Interest] QNAM::get() spawns three processess and opens file descriptors which I am unable to close
gsmember gs
gsmember at hotmail.de
Wed Aug 28 12:14:57 CEST 2013
Hello,
I am facing a problem with QNAM when using the following request class:
=================================================request.h:=================================================class Request: public QObject{ Q_OBJECTpublic: Request(); ~Request(); void func_startRequest(); private: QNetworkAccessManager *manager; QNetworkReply *reply; QUrl url; public slots: void slot_requestFinished();
=================================================request.cpp:=================================================#include "request.h" Request::Request(){ manager=new QNetworkAccessManager(this); reply=0;} Request::~Request(){ if(manager!=0){ manager->deleteLater(); } if(reply!=0){ reply->deleteLater(); }} void Request::func_startRequest(){ QNetworkRequest request; request.setUrl(QUrl("http://qt-project.org/")); reply=manager->get(request); connect(reply, SIGNAL(finished()), this, SLOT(slot_requestFinished()));} void Request::slot_requestFinished(){ disconnect(reply,SIGNAL(finished()),this,SLOT(slot_requestFinished())); /*QNetworkSession session(manager->configuration()); session.close(); session.stop(); reply->abort(); reply->close(); reply->deletelater(); manager->deleteLater(); I have tried all of this methods, nothing shut down the threads */}
My problem is that, whenever I call manager->get(), this spawns 3 processess, which I am unable to shut down. After a while (running many requests) there were a huge amount of running processess and open file descriptors. They are consuming RAM and running out of max open file descriptor limit...Every time I call manager->get(request) 3 new processess are spawnt.
I am using Qt 4.8.4 on Debian 5.
I have also checked the bugtracker and have found a few closed reports:https://bugreports.qt-project.org/browse/QTBUG-20148https://bugreports.qt-project.org/browse/QTBUG-20851
_gs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130828/73345c79/attachment.html>
More information about the Interest
mailing list