Results 1 to 4 of 4

Thread: Qt::WA_DeleteOnClose

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2006
    Posts
    46
    Thanks
    2
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Qt::WA_DeleteOnClose

    Looking for confirmation on this attribute and garbage collection. If I do the following:

    Qt Code:
    1. QWidget *Qw = new QWidget();
    2.  
    3. Qw->setAttribute(Qt::WA_DeleteOnClose, true);
    4. qDebug() << testAttribute(Qt::WA_DeleteOnClose); // paranoid confirmation
    5.  
    6. Qw->close();
    7.  
    8. // At this point I can still access Qw without any errors
    9. qDebug() << Qw->baseSize(); // pick any access function
    To copy to clipboard, switch view to plain text mode 

    Now this code never crashes for me, my guess would be that garbage collection happens when time permits and the post close access is playing Russian roulette.

    Is this the correct assumption?
    Last edited by merlvingian; 22nd November 2006 at 18:12. Reason: typo

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.