Re: [Interest] Lifetime of QNetworkReply from QNetworkAccessManager
Nothing. But Visual Studio says the QNetworkReply pointer is set to 0xfeeefeee so someone's freeing it. On segunda-feira, 29 de janeiro de 2018 20:06:37 PST Tom Isaacson wrote: > Ah thanks! Now I just have to figure out why calling deleteLater() is > causing a crash... What does valgrind say? -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Lifetime of QNetworkReply from QNetworkAccessManager
On segunda-feira, 29 de janeiro de 2018 20:06:37 PST Tom Isaacson wrote: > Ah thanks! Now I just have to figure out why calling deleteLater() is > causing a crash... What does valgrind say? -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Lifetime of QNetworkReply from QNetworkAccessManager
Ah thanks! Now I just have to figure out why calling deleteLater() is causing a crash... On 30/01/18, 4:48 PM, "Jason H" <jh...@gmx.com> wrote: > Sent: Monday, January 29, 2018 at 10:44 PM > From: "Tom Isaacson" <tom.isaac...@navico.com> > To: "Interest@qt-project.org" <Interest@qt-project.org> > Subject: [Interest] Lifetime of QNetworkReply from QNetworkAccessManager > > If I call a function like QNetworkAccessManager::head() with a QNetworkRequest I get a pointer to a QNetworkReply. But who's responsible for clearing up the QNetworkReply? Is it me, is it parented to the QNetworkReply, is it parented to the QNetworkAccessManager? If the latter, if the QNetworkAccessManager lasts for the lifetime of my application are all the QNetworkReply's going to take memory for the lifetime of the app? > > I'd expect this to be covered in the documentation but I can't see anything: > https://doc.qt.io/qt-5/qnetworkaccessmanager.html#head > It's in there: "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." ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Lifetime of QNetworkReply from QNetworkAccessManager
> Sent: Monday, January 29, 2018 at 10:44 PM > From: "Tom Isaacson" <tom.isaac...@navico.com> > To: "Interest@qt-project.org" <Interest@qt-project.org> > Subject: [Interest] Lifetime of QNetworkReply from QNetworkAccessManager > > If I call a function like QNetworkAccessManager::head() with a > QNetworkRequest I get a pointer to a QNetworkReply. But who's responsible for > clearing up the QNetworkReply? Is it me, is it parented to the QNetworkReply, > is it parented to the QNetworkAccessManager? If the latter, if the > QNetworkAccessManager lasts for the lifetime of my application are all the > QNetworkReply's going to take memory for the lifetime of the app? > > I'd expect this to be covered in the documentation but I can't see anything: > https://doc.qt.io/qt-5/qnetworkaccessmanager.html#head > It's in there: "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." ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
[Interest] Lifetime of QNetworkReply from QNetworkAccessManager
If I call a function like QNetworkAccessManager::head() with a QNetworkRequest I get a pointer to a QNetworkReply. But who's responsible for clearing up the QNetworkReply? Is it me, is it parented to the QNetworkReply, is it parented to the QNetworkAccessManager? If the latter, if the QNetworkAccessManager lasts for the lifetime of my application are all the QNetworkReply's going to take memory for the lifetime of the app? I'd expect this to be covered in the documentation but I can't see anything: https://doc.qt.io/qt-5/qnetworkaccessmanager.html#head Thanks, Tom Isaacson ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest