summaryrefslogtreecommitdiffstats
path: root/src/dbus/qdbusconnection_p.h
diff options
context:
space:
mode:
authorJohn Brooks <john.brooks@jollamobile.com>2013-09-04 00:21:32 -0600
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-14 06:58:24 +0200
commit6827728d5ac0e878cf330ecaea09a0cb21a7424d (patch)
tree98952d745ceffff3d52d44c2b7b377dd9fa2018d /src/dbus/qdbusconnection_p.h
parent2171b057e3e6273ae065b2754acec26887ad5ddf (diff)
Fix loss of valid dbus objects after unregisterObject
Partial revert of 3c6bb0ed8bfc9a2c679f4154585a16e47275ad21 and 57aed703d21c3a360d95fd9f85396d1283d3fdd0. When registering an object that was previously unregistered but not yet garbage collected, the activeChildren count on the parent node was not incremented, which could result in other registered objects disappearing after a later unregisterObject. Copying objects in the tree is not free, but it's not expensive enough or used frequently enough to justify that error-prone logic. It's much safer to simply remove objects immediately. Change-Id: I3dc59c2ebd07b237518424fcd8ea7371a22d6d15 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/dbus/qdbusconnection_p.h')
-rw-r--r--src/dbus/qdbusconnection_p.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/dbus/qdbusconnection_p.h b/src/dbus/qdbusconnection_p.h
index c702de141a..a61fdaf6c3 100644
--- a/src/dbus/qdbusconnection_p.h
+++ b/src/dbus/qdbusconnection_p.h
@@ -140,16 +140,16 @@ public:
{
typedef QVector<ObjectTreeNode> DataList;
- inline ObjectTreeNode() : obj(0), flags(0), activeChildren(0) { }
+ inline ObjectTreeNode() : obj(0), flags(0) { }
inline ObjectTreeNode(const QString &n) // intentionally implicit
- : name(n), obj(0), flags(0), activeChildren(0) { }
+ : name(n), obj(0), flags(0) { }
inline ~ObjectTreeNode() { }
inline bool operator<(const QString &other) const
{ return name < other; }
inline bool operator<(const QStringRef &other) const
{ return QStringRef(&name) < other; }
inline bool isActive() const
- { return obj || activeChildren; }
+ { return obj || !children.isEmpty(); }
QString name;
union {
@@ -157,7 +157,6 @@ public:
QDBusVirtualObject *treeNode;
};
int flags;
- int activeChildren;
DataList children;
};