From 094f1b97bb4f00fee593221015f55ecb5b538c0f Mon Sep 17 00:00:00 2001 From: "r.kuznetsov" Date: Mon, 15 Feb 2016 11:13:22 +0300 Subject: [PATCH] Fixed synchronization bug in engine context --- drape_frontend/engine_context.cpp | 2 ++ drape_frontend/engine_context.hpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/drape_frontend/engine_context.cpp b/drape_frontend/engine_context.cpp index b3554fff29..0b02161a8b 100644 --- a/drape_frontend/engine_context.cpp +++ b/drape_frontend/engine_context.cpp @@ -35,12 +35,14 @@ void EngineContext::Flush(TMapShapes && shapes) void EngineContext::FlushOverlays(TMapShapes && shapes) { + lock_guard lock(m_overlayShapesMutex); m_overlayShapes.reserve(m_overlayShapes.size() + shapes.size()); move(shapes.begin(), shapes.end(), back_inserter(m_overlayShapes)); } void EngineContext::EndReadTile() { + lock_guard lock(m_overlayShapesMutex); if (!m_overlayShapes.empty()) { TMapShapes overlayShapes; diff --git a/drape_frontend/engine_context.hpp b/drape_frontend/engine_context.hpp index ac29bc9fd6..d68e73383d 100644 --- a/drape_frontend/engine_context.hpp +++ b/drape_frontend/engine_context.hpp @@ -6,6 +6,8 @@ #include "drape/pointers.hpp" +#include "std/mutex.hpp" + namespace dp { class TextureManager; @@ -38,6 +40,7 @@ private: ref_ptr m_commutator; ref_ptr m_texMng; TMapShapes m_overlayShapes; + mutex m_overlayShapesMutex; }; } // namespace df