summaryrefslogtreecommitdiff
path: root/src/mbgl/sprite
diff options
context:
space:
mode:
authorRomain Quidet <romain.quidet.ext@mappy.com>2015-11-30 14:18:10 +0100
committerMinh Nguyễn <mxn@1ec5.org>2015-12-15 16:36:17 -0800
commitaf45d87e54e36f9899507d31c4b79669a254350e (patch)
tree0840dcb2a9b9736e28e32473b750a2687ade3743 /src/mbgl/sprite
parent02a32b55e4ec392d213d435354bbcd2f33cef40c (diff)
downloadqtlocation-mapboxgl-af45d87e54e36f9899507d31c4b79669a254350e.tar.gz
2210: Sprites can be removed / updated correctly
Diffstat (limited to 'src/mbgl/sprite')
-rw-r--r--src/mbgl/sprite/sprite_atlas.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mbgl/sprite/sprite_atlas.cpp b/src/mbgl/sprite/sprite_atlas.cpp
index 6ebebb9507..b04d8edc5f 100644
--- a/src/mbgl/sprite/sprite_atlas.cpp
+++ b/src/mbgl/sprite/sprite_atlas.cpp
@@ -187,8 +187,15 @@ void SpriteAtlas::updateDirty() {
// The two names match;
Holder& holder = imageIterator->second;
holder.texture = spriteIterator->second;
- copy(holder, imageIterator->first.second);
-
+ if (holder.texture != nullptr)
+ {
+ copy(holder, imageIterator->first.second);
+ }
+ else
+ {
+ images.erase(imageIterator);
+ }
+
++imageIterator;
// Don't advance the spriteIterator because there might be another sprite with the same
// name, but a different wrap value.