You needlessly create a new QNetworkAccessManager on each call to getData()
Moreover, you never delete it. So each call to getData() leaks a QNetworkAccessManager instance.
Since you already have m_networkManager as an instance member, only create one QNAM instance and re-use it.
Regarding 2 QNAM: that is possible and does not create issues. Using one QNAM is usually more efficient since the instance can then do all kinds of tricks to optimize e.g. connects, like re-using sockets, re-using SSL sessions, etc.
See Peter Hartmann's presentation at this year's Qt Developer Days: http://devdays.kdab.com/wp-content/u...k-features.pdf
Cheers,
_





Reply With Quote

Bookmarks