Looking for confirmation on this attribute and garbage collection. If I do the following:
Qw->setAttribute(Qt::WA_DeleteOnClose, true);
qDebug() << testAttribute(Qt::WA_DeleteOnClose); // paranoid confirmation
Qw->close();
// At this point I can still access Qw without any errors
qDebug() << Qw->baseSize(); // pick any access function
QWidget *Qw = new QWidget();
Qw->setAttribute(Qt::WA_DeleteOnClose, true);
qDebug() << testAttribute(Qt::WA_DeleteOnClose); // paranoid confirmation
Qw->close();
// At this point I can still access Qw without any errors
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?
Bookmarks