diff --git a/src/mbgl/geometry/line_atlas.cpp b/src/mbgl/geometry/line_atlas.cpp index dc5ee0901..b516723cd 100644 --- a/src/mbgl/geometry/line_atlas.cpp +++ b/src/mbgl/geometry/line_atlas.cpp @@ -21,8 +21,10 @@ LineAtlas::LineAtlas(uint16_t w, uint16_t h) LineAtlas::~LineAtlas() { std::lock_guard lock(mtx); - Environment::Get().abandonTexture(texture); - texture = 0; + if (texture) { + Environment::Get().abandonTexture(texture); + texture = 0; + } } LinePatternPos LineAtlas::getDashPosition(const std::vector &dasharray, bool round) {