From 9dc48b773fe1c614655b5c7a7645b3ee9f1fa557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Wed, 6 Aug 2014 18:33:21 +0200 Subject: [PATCH] fix crash bug for styles that have no glyph url specified --- include/mbgl/text/glyph_store.hpp | 6 ++++-- src/map/map.cpp | 12 ++---------- src/text/glyph_store.cpp | 11 +++++++++-- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/include/mbgl/text/glyph_store.hpp b/include/mbgl/text/glyph_store.hpp index 66cf8e75b..fbfd0dde6 100644 --- a/include/mbgl/text/glyph_store.hpp +++ b/include/mbgl/text/glyph_store.hpp @@ -62,13 +62,15 @@ private: // Manages Glyphrange PBF loading. class GlyphStore { public: - GlyphStore(const std::string &glyphURL); + GlyphStore(); // Block until all specified GlyphRanges of the specified font stack are loaded. void waitForGlyphRanges(const std::string &fontStack, const std::set &glyphRanges); FontStack &getFontStack(const std::string &fontStack); + void setURL(const std::string &url); + private: // Loads an individual glyph range from the font stack and adds it to rangeSets std::shared_future loadGlyphRange(const std::string &fontStack, std::map> &rangeSets, GlyphRange range); @@ -76,7 +78,7 @@ private: FontStack &createFontStack(const std::string &fontStack); public: - const std::string glyphURL; + std::string glyphURL; private: std::unordered_map>> ranges; diff --git a/src/map/map.cpp b/src/map/map.cpp index 4b4e58d14..bcdcd8479 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -33,6 +33,7 @@ Map::Map(View& view) transform(view), style(std::make_shared