summaryrefslogtreecommitdiffstats
path: root/src/core/resources
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/resources
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/resources')
-rw-r--r--src/core/resources/qframeallocator.cpp5
-rw-r--r--src/core/resources/qframeallocator_p.h5
2 files changed, 3 insertions, 7 deletions
diff --git a/src/core/resources/qframeallocator.cpp b/src/core/resources/qframeallocator.cpp
index ead5a790e..c62e7ad0d 100644
--- a/src/core/resources/qframeallocator.cpp
+++ b/src/core/resources/qframeallocator.cpp
@@ -53,13 +53,12 @@ namespace Qt3D {
\class Qt3D::QFrameAllocatorPrivate
\internal
*/
-QFrameAllocatorPrivate::QFrameAllocatorPrivate(QFrameAllocator *qq)
- : q_ptr(qq)
+QFrameAllocatorPrivate::QFrameAllocatorPrivate()
{
}
QFrameAllocator::QFrameAllocator(uint maxObjectSize, uint alignment, uint pageSize)
- : d_ptr(new QFrameAllocatorPrivate(this))
+ : d_ptr(new QFrameAllocatorPrivate)
{
Q_ASSERT(alignment && pageSize && pageSize < UCHAR_MAX);
Q_D(QFrameAllocator);
diff --git a/src/core/resources/qframeallocator_p.h b/src/core/resources/qframeallocator_p.h
index dbf68ea63..990066138 100644
--- a/src/core/resources/qframeallocator_p.h
+++ b/src/core/resources/qframeallocator_p.h
@@ -91,7 +91,7 @@ private:
class QFrameAllocatorPrivate
{
public:
- QFrameAllocatorPrivate(QFrameAllocator *qq);
+ QFrameAllocatorPrivate();
inline void *allocateAtChunk(uint allocatorIndex)
{
@@ -108,9 +108,6 @@ public:
return (targetSize + m_alignment - 1) / m_alignment - 1;
}
- Q_DECLARE_PUBLIC(QFrameAllocator)
- QFrameAllocator *q_ptr;
-
uint m_maxObjectSize;
uint m_alignment;
QVector<QFixedFrameAllocator> m_allocatorPool;