Skip to content

Commit

Permalink
Merge pull request #50 from henopied/NEXT-33
Browse files Browse the repository at this point in the history
Fixed memory leak bug
  • Loading branch information
kscc25 committed Mar 19, 2016
2 parents d1fec14 + 9f63619 commit b25a390
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client/js/ball-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ class BallView {
if (eater && eater.ball.id != this.ball.id) {
this.x.follow(() => eater.x.get(), 100);
this.y.follow(() => eater.y.get(), 100);
setTimeout(() => this.disappear(), 50);
setTimeout(() => {
this.disappear();
delete this.main.balls[this.ball.id];
}, 50);
} else {
this.disappear();
}
Expand Down

0 comments on commit b25a390

Please sign in to comment.