From 78fda8bb62a85fe0a536d2f38832a6123739e4c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Fri, 30 May 2014 17:00:47 +0200 Subject: [PATCH] make sure we retain shared state when destructing the map object refs #261 --- include/llmr/map/map.hpp | 21 +++--- include/llmr/map/tile_data.hpp | 2 + include/llmr/map/tile_parser.hpp | 22 ++++-- include/llmr/map/vector_tile_data.hpp | 4 + include/llmr/renderer/raster_bucket.hpp | 2 +- include/llmr/util/raster.hpp | 4 +- src/map/map.cpp | 59 ++++++++------- src/map/tile_data.cpp | 15 +++- src/map/tile_parser.cpp | 97 +++++++++++++++---------- src/map/vector_tile_data.cpp | 15 +++- src/renderer/painter_clipping.cpp | 12 +-- src/renderer/painter_fill.cpp | 6 +- src/renderer/painter_icon.cpp | 4 +- src/renderer/painter_line.cpp | 2 +- src/renderer/painter_raster.cpp | 2 +- src/renderer/painter_text.cpp | 9 ++- src/renderer/raster_bucket.cpp | 2 +- src/util/raster.cpp | 6 +- 18 files changed, 174 insertions(+), 110 deletions(-) diff --git a/include/llmr/map/map.hpp b/include/llmr/map/map.hpp index 49050540c..5f46c0e7e 100644 --- a/include/llmr/map/map.hpp +++ b/include/llmr/map/map.hpp @@ -97,13 +97,13 @@ public: public: inline const TransformState &getState() const { return state; } - inline const Style &getStyle() const { return style; } - inline GlyphAtlas &getGlyphAtlas() { return glyphAtlas; } - inline GlyphStore &getGlyphStore() { return glyphStore; } - inline SpriteAtlas &getSpriteAtlas() { return spriteAtlas; } + inline std::shared_ptr getStyle() const { return style; } + inline std::shared_ptr getGlyphAtlas() { return glyphAtlas; } + inline std::shared_ptr getGlyphStore() { return glyphStore; } + inline std::shared_ptr getSpriteAtlas() { return spriteAtlas; } + inline std::shared_ptr getTexturepool() { return texturepool; } inline uv_loop_t *getLoop() { return loop; } inline time getAnimationTime() const { return animationTime; } - inline Texturepool &getTexturepool() { return texturepool; } inline const Sources &getSources() { return sources; } private: @@ -151,11 +151,12 @@ private: Transform transform; TransformState state; - Texturepool texturepool; - Style style; - GlyphAtlas glyphAtlas; - GlyphStore glyphStore; - SpriteAtlas spriteAtlas; + std::shared_ptr