Results 1 to 3 of 3

Thread: QNetworkAccessManager crash with deleting parent pointer

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QNetworkAccessManager crash with deleting parent pointer

    only posting limited code is really annoying - hiding context doesnt help!

    how are Class1 'new'd ? do they have parents? If they have a parent, you should not 'delete' it.

    where is this
    Qt Code:
    1. for(int i=0; i< list.count(); i++)
    2. {
    3. Class1* t = (Class1*)list.at(i);
    4. t->stop();
    5. delete t;
    6. }
    To copy to clipboard, switch view to plain text mode 
    ? what class? what function?

    Why does class1 control the others' scope when it seems like it should be the most independant class?

    Have you used the dubugger? I'm sure it gave you more information than 'crash'. Why didnt you include that here?
    Last edited by amleto; 16th October 2011 at 23:32.

Similar Threads

  1. Correctly deleting a qwidget with no parent
    By boblatino in forum Qt Programming
    Replies: 3
    Last Post: 27th July 2010, 06:01
  2. deleting invalid pointer
    By hollowhead in forum General Programming
    Replies: 11
    Last Post: 30th April 2010, 10:47
  3. Deleting Class causes app crash
    By been_1990 in forum Qt Programming
    Replies: 8
    Last Post: 29th January 2010, 17:52
  4. deleting internal pointer in QModelIndex
    By rickbsgu in forum Qt Programming
    Replies: 18
    Last Post: 24th December 2008, 02:24
  5. Replies: 1
    Last Post: 28th July 2006, 14:10

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.