Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
- index f6234df..eb2a6b2 100644
- --- a/src/corelib/kernel/qobject.cpp
- +++ b/src/corelib/kernel/qobject.cpp
- @@ -165,6 +165,7 @@ QObjectPrivate::QObjectPrivate(int version)
- pendTimer = false; // no timers yet
- blockSig = false; // not blocking signals
- wasDeleted = false; // double-delete catcher
- + isDeletingChildren = false; // set by deleteChildren()
- sendChildEvents = true; // if we should send ChildInsert and ChildRemove events to parent
- receiveChildEvents = true;
- postedEvents = 0;
- @@ -1660,8 +1661,8 @@ void QObject::setParent(QObject *parent)
- void QObjectPrivate::deleteChildren()
- {
- - const bool reallyWasDeleted = wasDeleted;
- - wasDeleted = true;
- + const bool reallyIsDeletingChildren = isDeletingChildren;
- + isDeletingChildren = true;
- // delete children objects
- // don't use qDeleteAll as the destructor of the child might
- // delete siblings
- @@ -1672,7 +1673,7 @@ void QObjectPrivate::deleteChildren()
- }
- children.clear();
- currentChildBeingDeleted = 0;
- - wasDeleted = reallyWasDeleted;
- + isDeletingChildren = reallyIsDeletingChildren;
- }
- void QObjectPrivate::setParent_helper(QObject *o)
- @@ -1682,13 +1683,13 @@ void QObjectPrivate::setParent_helper(QObject *o)
- return;
- if (parent) {
- QObjectPrivate *parentD = parent->d_func();
- - if (parentD->wasDeleted && wasDeleted
- + if (parentD->isDeletingChildren && wasDeleted
- && parentD->currentChildBeingDeleted == q) {
- // don't do anything since QObjectPrivate::deleteChildren() already
- // cleared our entry in parentD->children.
- } else {
- const int index = parentD->children.indexOf(q);
- - if (parentD->wasDeleted) {
- + if (parentD->isDeletingChildren) {
- parentD->children[index] = 0;
- } else {
- parentD->children.removeAt(index);
- @@ -1715,7 +1716,7 @@ void QObjectPrivate::setParent_helper(QObject *o)
- }
- }
- }
- - if (!wasDeleted && declarativeData)
- + if (!isDeletingChildren && declarativeData)
- QAbstractDeclarativeData::parentChanged(declarativeData, q, o);
- }
- diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
- index 8702d37..3729dc8 100644
- --- a/src/corelib/kernel/qobject.h
- +++ b/src/corelib/kernel/qobject.h
- @@ -99,13 +99,14 @@ public:
- uint pendTimer : 1;
- uint blockSig : 1;
- uint wasDeleted : 1;
- + uint isDeletingChildren : 1;
- uint ownObjectName : 1;
- uint sendChildEvents : 1;
- uint receiveChildEvents : 1;
- uint inEventHandler : 1; //only used if QT_JAMBI_BUILD
- uint inThreadChangeEvent : 1;
- uint isWindow : 1; //for QWindow
- - uint unused : 22;
- + uint unused : 21;
- int postedEvents;
- QMetaObject *metaObject; // assert dynamic
- };
Add Comment
Please, Sign In to add comment