summaryrefslogtreecommitdiffstats
path: root/src/core/qscene.cpp
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2015-05-18 06:48:29 +0400
committerKonstantin Ritt <ritt.ks@gmail.com>2015-05-20 05:55:12 +0000
commitee2b4e7cba8f7451ca974a1f461c90932f232624 (patch)
treea88fc99d73b8084cd2bd63e15b32ec745965696f /src/core/qscene.cpp
parentbfae282e8fb6d6d83e92df712f93b583616169d9 (diff)
Properly initialize q_ptr (or avoid where it is not needed)
Referencing a partially-constructed object is typically a bad design. Change-Id: I48ef92452202f6c8c0014e17efd20e2ee2ae7e40 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/core/qscene.cpp')
-rw-r--r--src/core/qscene.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/core/qscene.cpp b/src/core/qscene.cpp
index a4a9733fc..cf3329b25 100644
--- a/src/core/qscene.cpp
+++ b/src/core/qscene.cpp
@@ -49,15 +49,12 @@ namespace Qt3D {
class QScenePrivate
{
public:
- QScenePrivate(QAspectEngine *engine, QScene *qq)
- : q_ptr(qq)
- , m_engine(engine)
+ QScenePrivate(QAspectEngine *engine)
+ : m_engine(engine)
, m_arbiter(Q_NULLPTR)
{
}
- Q_DECLARE_PUBLIC(QScene)
- QScene *q_ptr;
QAspectEngine *m_engine;
QHash<QNodeId, QNode *> m_nodeLookupTable;
QMultiHash<QNodeId, QNodeId> m_componentToEntities;
@@ -70,7 +67,7 @@ public:
QScene::QScene(QAspectEngine *engine)
- : d_ptr(new QScenePrivate(engine, this))
+ : d_ptr(new QScenePrivate(engine))
{
}