Results 1 to 2 of 2

Thread: Does QNetworkRequest need to persist with QNetworkReply?

  1. #1
    Join Date
    Jan 2010
    Location
    Perth, Australia
    Posts
    37
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Does QNetworkRequest need to persist with QNetworkReply?

    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!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Does QNetworkRequest need to persist with QNetworkReply?

    Quote Originally Posted by hackerNovitiate View Post
    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    hackerNovitiate (12th December 2010)

Similar Threads

  1. Replies: 10
    Last Post: 12th September 2010, 20:16
  2. Replies: 0
    Last Post: 3rd August 2010, 10:07
  3. QNetworkRequest file upload -- please help
    By Runtime Technologies in forum Qt Programming
    Replies: 3
    Last Post: 14th July 2009, 16:55
  4. How to see the final request from QNetworkRequest
    By krippy2k in forum Qt Programming
    Replies: 13
    Last Post: 7th June 2009, 22:37
  5. Replies: 5
    Last Post: 20th January 2009, 15:11

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.