mirror of https://github.com/axmolengine/axmol.git
Fix event listener cleanup in destructor
Event listeners should always be removed at destroy (move out of if-block)
This commit is contained in:
parent
7cea464a11
commit
5328996a18
|
@ -294,10 +294,9 @@ Label::~Label()
|
|||
if (_fontAtlas)
|
||||
{
|
||||
FontAtlasCache::releaseFontAtlas(_fontAtlas);
|
||||
|
||||
_eventDispatcher->removeEventListener(_purgeTextureListener);
|
||||
_eventDispatcher->removeEventListener(_resetTextureListener);
|
||||
}
|
||||
_eventDispatcher->removeEventListener(_purgeTextureListener);
|
||||
_eventDispatcher->removeEventListener(_resetTextureListener);
|
||||
|
||||
CC_SAFE_RELEASE_NULL(_reusedLetter);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue