forked from organicmaps/organicmaps
Fixed synchronization bug in engine context
This commit is contained in:
parent
bc514eaa32
commit
094f1b97bb
2 changed files with 5 additions and 0 deletions
|
@ -35,12 +35,14 @@ void EngineContext::Flush(TMapShapes && shapes)
|
|||
|
||||
void EngineContext::FlushOverlays(TMapShapes && shapes)
|
||||
{
|
||||
lock_guard<mutex> 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<mutex> lock(m_overlayShapesMutex);
|
||||
if (!m_overlayShapes.empty())
|
||||
{
|
||||
TMapShapes overlayShapes;
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
#include "drape/pointers.hpp"
|
||||
|
||||
#include "std/mutex.hpp"
|
||||
|
||||
namespace dp
|
||||
{
|
||||
class TextureManager;
|
||||
|
@ -38,6 +40,7 @@ private:
|
|||
ref_ptr<ThreadsCommutator> m_commutator;
|
||||
ref_ptr<dp::TextureManager> m_texMng;
|
||||
TMapShapes m_overlayShapes;
|
||||
mutex m_overlayShapesMutex;
|
||||
};
|
||||
|
||||
} // namespace df
|
||||
|
|
Loading…
Add table
Reference in a new issue