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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,8 +59,6 @@ public:
|
||||
spriteAtlas_.reset();
|
||||
glyphAtlas_.reset();
|
||||
glyphStore_.reset();
|
||||
|
||||
env_.performCleanup();
|
||||
}
|
||||
|
||||
void update() {
|
||||
|
||||
Reference in New Issue
Block a user