diff options
author | Keränen Pasi <pasi.keranen@digia.com> | 2013-06-27 15:35:21 +0300 |
---|---|---|
committer | Pasi Keränen <pasi.keranen@digia.com> | 2013-06-28 09:32:15 +0300 |
commit | 935235c7a5bd6047deeef362cb8937f63188221e (patch) | |
tree | 42d3425bb6f98b5da25a48491e67af879fc2e86d /src/datavis3dqml2/declarativebars.cpp | |
parent | a6276dcd09344624f8e5a981676e3ac80de1b967 (diff) |
Fix thread affinity and qmlbarchart crash on exit.
Change-Id: I6b74917dd6deba4d9f33fa1286e7acd316848eca
Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'src/datavis3dqml2/declarativebars.cpp')
-rw-r--r-- | src/datavis3dqml2/declarativebars.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/datavis3dqml2/declarativebars.cpp b/src/datavis3dqml2/declarativebars.cpp index 3be425e3..74de4644 100644 --- a/src/datavis3dqml2/declarativebars.cpp +++ b/src/datavis3dqml2/declarativebars.cpp @@ -66,6 +66,9 @@ DeclarativeBars::DeclarativeBars(QQuickItem *parent) // TODO: These seem to have no effect; find a way to activate anti-aliasing setAntialiasing(true); setSmooth(true); + + // Create the shared component on the main GUI thread. + m_shared = new Bars3dController(boundingRect().toRect()); } DeclarativeBars::~DeclarativeBars() @@ -85,10 +88,8 @@ void DeclarativeBars::componentComplete() QSGNode *DeclarativeBars::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) { - if (!m_shared) { - m_shared = new Bars3dController(boundingRect().toRect()); - m_shared->initializeOpenGL(); - } + // Call initialize on each update paint node and let the shared code worry about it. + m_shared->initializeOpenGL(); // Check if properites have changed that need to be applied while on the SGRenderThread if (m_cachedState->m_isSampleSpaceSet) { |