Results 1 to 5 of 5

Thread: QNetworkAccessManager Memory leak

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2012
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question QNetworkAccessManager Memory leak

    Qt Code:
    1. while(1){
    2. QNetworkAccessManager *aa = new QNetworkAccessManager();
    3. QNetworkReply *bb;
    4. QNetworkRequest Request;
    5. Request.setUrl(QUrl("http://127.0.0.1"));
    6.  
    7. bb= aa->get(Request);
    8. bb->abort();
    9. bb->close();
    10. bb->deleteLater();
    11. bb = NULL;
    12.  
    13. delete aa;
    14. aa = NULL;
    15. }
    To copy to clipboard, switch view to plain text mode 

    i have a web spider project using QNetworkAccessManager,this code is a example,run this code
    you can see the memory no leak,but most people no carefully review the other information in the code's progress
    use progress view or windows7 task manager ,you can see the handle-count,up up up

    after a while,the progress memory Perhaps still between 30M - 60M

    but the handle count has not been reduced.

    if the handle count > 1,000,000,the program died

    what's the problem,i try to watch QNetworkAccessManager class's code,but no help

    it's QNetworkAccessManager class's bug,not my,right?

    if it's my problem,how can i fix it,and where

    os:win7 + qt4.8.1
    Last edited by newgod; 27th July 2012 at 02:08. Reason: updated contents

Similar Threads

  1. Qt example with memory leak
    By Squall in forum Qt Programming
    Replies: 5
    Last Post: 21st February 2011, 10:07
  2. memory leak - where?
    By Tomasz in forum Newbie
    Replies: 36
    Last Post: 5th September 2010, 23:47
  3. Memory leak
    By yxtx1984 in forum Qt Programming
    Replies: 4
    Last Post: 26th February 2010, 11:13
  4. memory leak
    By mattia in forum Newbie
    Replies: 18
    Last Post: 16th January 2008, 10:22
  5. Memory leak
    By vvbkumar in forum General Programming
    Replies: 4
    Last Post: 2nd September 2006, 15:31

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
  •  
Qt is a trademark of The Qt Company.