Using pendingRemove flag when destroying BaseSound

This commit is contained in:
Pavle Goloskokovic 2018-01-04 19:38:51 +01:00
parent 5d5acb40a9
commit 03187ae8b5

View file

@ -285,7 +285,10 @@ var BaseSound = new Class({
*/
update: NOOP,
destroy: function () {
this.manager.remove(this); // TODO replace with pendingRemove
if (this.pendingRemove) {
return;
}
this.pendingRemove = true;
this.manager = null;
this.key = '';
this.isPlaying = false;