Do not call abandon texture if there is no texture

Check if the texture was created before abandoning on SpriteAtlas
destructor. Linux driver was fine with that, but was crashing on Mac.
This commit is contained in:
Thiago Marcos P. Santos
2015-05-22 15:21:39 +03:00
parent 3cf76ce907
commit eaf1c24cdc
2 changed files with 4 additions and 4 deletions

View File

@@ -299,6 +299,8 @@ void SpriteAtlas::bind(bool linear) {
SpriteAtlas::~SpriteAtlas() {
std::lock_guard<std::recursive_mutex> lock(mtx);
Environment::Get().abandonTexture(texture);
texture = 0;
if (texture) {
Environment::Get().abandonTexture(texture);
texture = 0;
}
}

View File

@@ -59,8 +59,6 @@ public:
spriteAtlas_.reset();
glyphAtlas_.reset();
glyphStore_.reset();
env_.performCleanup();
}
void update() {