From 3884998f3b44f3bbbf4a627c66754c99566e33ef Mon Sep 17 00:00:00 2001 From: lennartboeckx Date: Sun, 17 Dec 2017 22:14:41 +0100 Subject: [PATCH] fixed memory leak because eventlisteners weren't destroyed (#3728) --- lib/timeline/Core.js | 1 + lib/timeline/component/ItemSet.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lib/timeline/Core.js b/lib/timeline/Core.js index dee44004..719c77cf 100644 --- a/lib/timeline/Core.js +++ b/lib/timeline/Core.js @@ -527,6 +527,7 @@ Core.prototype.destroy = function () { } } this.listeners = null; + this.hammer && this.hammer.destroy(); this.hammer = null; // give all components the opportunity to cleanup diff --git a/lib/timeline/component/ItemSet.js b/lib/timeline/component/ItemSet.js index a5b0b688..2df52931 100644 --- a/lib/timeline/component/ItemSet.js +++ b/lib/timeline/component/ItemSet.js @@ -483,6 +483,8 @@ ItemSet.prototype.destroy = function() { this.setItems(null); this.setGroups(null); + this.hammer && this.hammer.destroy(); + this.groupHammer && this.groupHammer.destroy(); this.hammer = null; this.body = null;