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>
This commit is contained in:
Ulf Hermann 2019-06-12 11:42:25 +02:00
parent a16f4fe660
commit 75895afd7d
1 changed files with 6 additions and 0 deletions

View File

@ -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 {