Hi,

Think of the following code:


QObject *parent = new QObject();
QObject *childA = new QObject(parent);
QObject *childB = new QObject)parent);

delete parent;


In which order would you expect childA and childB gets deleted? I would
expect childB first and childA second. This would be same behavior as in
using normal variables:

QObject parent;
QObject childA(&parent);
QObject childB(&parent);

Here, on leaving the scope childB would be deleted first, childA second
and parent last.

Isn't it a bug in Qt to delete children in the same order there were
added to a parent instead of the reverse order?

Regards, Jochen


_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to