aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickshapes
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-06-12 11:42:25 +0200
committerUlf Hermann <ulf.hermann@qt.io>2019-06-14 10:41:18 +0000
commit75895afd7d2b8b6a82838600aabe24f5bb5e4c79 (patch)
treeebde2509c43bff273221e3e3de62c0efbf1ff7e8 /src/quickshapes
parenta16f4fe660de843c1a392b5bf1649c2df21e1522 (diff)
Do qtVectorPathForPath before starting thread pool
This avoids the race condition created by calling it the first time inside the threads. Fixes: QTBUG-76338 Fixes: QTBUG-76069 Change-Id: I6108526eb6f5b5ba9c3334437102fc5959f53030 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/quickshapes')
-rw-r--r--src/quickshapes/qquickshapegenericrenderer.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/quickshapes/qquickshapegenericrenderer.cpp b/src/quickshapes/qquickshapegenericrenderer.cpp
index 604da2a889..68102f1e0a 100644
--- a/src/quickshapes/qquickshapegenericrenderer.cpp
+++ b/src/quickshapes/qquickshapegenericrenderer.cpp
@@ -361,6 +361,9 @@ void QQuickShapeGenericRenderer::endSync(bool async)
});
didKickOffAsync = true;
#if QT_CONFIG(thread)
+ // qtVectorPathForPath() initializes a unique_ptr without locking.
+ // Do that before starting the threads as otherwise we get a race condition.
+ qtVectorPathForPath(r->path);
pathWorkThreadPool->start(r);
#endif
} else {
@@ -391,6 +394,9 @@ void QQuickShapeGenericRenderer::endSync(bool async)
});
didKickOffAsync = true;
#if QT_CONFIG(thread)
+ // qtVectorPathForPath() initializes a unique_ptr without locking.
+ // Do that before starting the threads as otherwise we get a race condition.
+ qtVectorPathForPath(r->path);
pathWorkThreadPool->start(r);
#endif
} else {