File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 3333
3434#include < QDomDocument>
3535#include < QDomNode>
36+ #include < QMutexLocker>
3637#include < QPainter>
3738#include < QListIterator>
3839#include < QSettings>
@@ -214,6 +215,9 @@ void QgsMapRenderer::adjustExtentToSize()
214215
215216void QgsMapRenderer::render ( QPainter* painter )
216217{
218+ // Lock render method for concurrent threads (e.g. from globe)
219+ QMutexLocker renderLock ( &mRenderMutex );
220+
217221 // flag to see if the render context has changed
218222 // since the last time we rendered. If it hasnt changed we can
219223 // take some shortcuts with rendering
Original file line number Diff line number Diff line change 1616#ifndef QGSMAPRENDER_H
1717#define QGSMAPRENDER_H
1818
19+ #include < QMutex>
1920#include < QSize>
2021#include < QStringList>
2122#include < QVector>
@@ -318,6 +319,9 @@ class CORE_EXPORT QgsMapRenderer : public QObject
318319
319320 // ! Labeling engine (NULL by default)
320321 QgsLabelingEngineInterface* mLabelingEngine ;
322+
323+ // ! Locks rendering loop for concurrent draws
324+ QMutex mRenderMutex ;
321325};
322326
323327#endif
You can’t perform that action at this time.
0 commit comments