Skip to content

Commit

Permalink
fix memory leak due to rockets never being returned to spareParticles…
Browse files Browse the repository at this point in the history
… array
  • Loading branch information
skeltoac committed Dec 16, 2011
1 parent 91a05d6 commit d9a2722
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/canvas.js
Expand Up @@ -668,7 +668,7 @@
if ( typeof this.imgs == 'object' )
this.img = this.imgs[ i % this.imgs.length ];
} else {
this.disable();
this.disable(true);
}
}
};
Expand All @@ -693,8 +693,8 @@
this.y = y;
};

Particle.prototype.disable = function() {
if (this.enabled && this.expendable) {
Particle.prototype.disable = function(force) {
if (this.enabled && ( this.expendable || force ) ) {
this.enabled = false;
this.fireworks.spareParticles.push(this);
}
Expand Down

0 comments on commit d9a2722

Please sign in to comment.