diff options
author | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2018-07-18 10:50:43 +0300 |
---|---|---|
committer | Vlad Mihaylenko <vxmihaylenko@gmail.com> | 2018-07-20 14:51:41 +0300 |
commit | 60e4545dbd7c4fa387f4aafdcc2cd5f1e964aeab (patch) | |
tree | 201b9246c1a720606d9d035b9662b4e5f11c88b1 /drape/glyph_generator.cpp | |
parent | bb4790be592d2281f011ec97db4f41b2458b0bac (diff) |
Fixed ANR and black artefacts on Samsung Galaxy S
Diffstat (limited to 'drape/glyph_generator.cpp')
-rw-r--r-- | drape/glyph_generator.cpp | 17 |
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); |