PDA

View Full Version : Does QNetworkRequest need to persist with QNetworkReply?



hackerNovitiate
12th December 2010, 10:23
Does the QNetworkRequest passed into QNetworkAccessManager::get() need to persist until the corresponding QNetworkReply receives all data? Or is it safe to let it be destroyed immediately after the QNetworkReply is constructed? (i.e. is it safe to use a local variable that will disappear shortly after get() is called?)

I've just smoothed out a crash-riddled session, but am still paranoid about hidden bugs. Thanks in advance!

wysota
12th December 2010, 16:45
Does the QNetworkRequest passed into QNetworkAccessManager::get() need to persist until the corresponding QNetworkReply receives all data? Or is it safe to let it be destroyed immediately after the QNetworkReply is constructed? (i.e. is it safe to use a local variable that will disappear shortly after get() is called?)
QNetworkRequest is a value-based object so you can safely get rid of it after you're done using it. QNAM will have its own copy of the object.