Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'drape/glyph_generator.cpp')
-rw-r--r--drape/glyph_generator.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/drape/glyph_generator.cpp b/drape/glyph_generator.cpp
index bd235cb3ef..c693dd695b 100644
--- a/drape/glyph_generator.cpp
+++ b/drape/glyph_generator.cpp
@@ -19,11 +19,7 @@ GlyphGenerator::~GlyphGenerator()
// Here we have to wait for active tasks completion,
// because they capture 'this' pointer.
- m_activeTasks.FinishAll();
-
- std::lock_guard<std::mutex> lock(m_mutex);
- for (auto & data : m_queue)
- data.DestroyGlyph();
+ FinishGeneration();
}
bool GlyphGenerator::IsSuspended() const
@@ -32,6 +28,17 @@ bool GlyphGenerator::IsSuspended() const
return m_glyphsCounter == 0;
}
+void GlyphGenerator::FinishGeneration()
+{
+ m_activeTasks.FinishAll();
+
+ std::lock_guard<std::mutex> lock(m_mutex);
+ for (auto & data : m_queue)
+ data.DestroyGlyph();
+
+ m_glyphsCounter = 0;
+}
+
void GlyphGenerator::RegisterListener(ref_ptr<GlyphGenerator::Listener> listener)
{
std::lock_guard<std::mutex> lock(m_mutex);