summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Zugaldia <antonio@silicalabs.com>2015-09-16 13:39:58 -0400
committerAntonio Zugaldia <antonio@silicalabs.com>2015-09-16 13:39:58 -0400
commit802b78cc2cd69d4be1382ff841b5fb55221b93a1 (patch)
tree83424a2fd442a6d9df867373ca0abbb5051f0102
parent573b43f257fbd4da0b7c87a526c8df61b4165a97 (diff)
parentd83be119472704973697b089321b14ce33cd9956 (diff)
downloadqtlocation-mapboxgl-802b78cc2cd69d4be1382ff841b5fb55221b93a1.tar.gz
Merge remote-tracking branch 'mapbox/master' into 2317-espresso
-rw-r--r--src/mbgl/geometry/glyph_atlas.cpp11
-rw-r--r--src/mbgl/geometry/glyph_atlas.hpp1
2 files changed, 12 insertions, 0 deletions
diff --git a/src/mbgl/geometry/glyph_atlas.cpp b/src/mbgl/geometry/glyph_atlas.cpp
index 43ea585531..b90444e582 100644
--- a/src/mbgl/geometry/glyph_atlas.cpp
+++ b/src/mbgl/geometry/glyph_atlas.cpp
@@ -5,6 +5,8 @@
#include <mbgl/platform/gl.hpp>
#include <mbgl/platform/log.hpp>
#include <mbgl/platform/platform.hpp>
+#include <mbgl/util/gl_object_store.hpp>
+#include <mbgl/util/thread_context.hpp>
#include <cassert>
#include <algorithm>
@@ -20,6 +22,15 @@ GlyphAtlas::GlyphAtlas(uint16_t width_, uint16_t height_)
dirty(true) {
}
+GlyphAtlas::~GlyphAtlas() {
+ assert(util::ThreadContext::currentlyOn(util::ThreadType::Map));
+
+ if (texture) {
+ mbgl::util::ThreadContext::getGLObjectStore()->abandonTexture(texture);
+ texture = 0;
+ }
+}
+
void GlyphAtlas::addGlyphs(uintptr_t tileUID,
const std::u32string& text,
const std::string& stackName,
diff --git a/src/mbgl/geometry/glyph_atlas.hpp b/src/mbgl/geometry/glyph_atlas.hpp
index c5c785994d..1205301835 100644
--- a/src/mbgl/geometry/glyph_atlas.hpp
+++ b/src/mbgl/geometry/glyph_atlas.hpp
@@ -17,6 +17,7 @@ namespace mbgl {
class GlyphAtlas : public util::noncopyable {
public:
GlyphAtlas(uint16_t width, uint16_t height);
+ ~GlyphAtlas();
void addGlyphs(uintptr_t tileUID,
const std::u32string& text,