From 4f4215ced52fc4179058c350545bfaea7ee8bfff Mon Sep 17 00:00:00 2001 From: Severin Opel Date: Mon, 12 Aug 2019 10:04:03 +0200 Subject: [PATCH 1/2] Close callbacks on Scatter are now removed on close. --- lib/scatter.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/scatter.js b/lib/scatter.js index b841647..403c095 100644 --- a/lib/scatter.js +++ b/lib/scatter.js @@ -371,6 +371,7 @@ export class AbstractScatter extends Throwable { close() { this._callCloseCallbacks() + this._removeCallbacks() this._removeSelfFromScatterContainer() } @@ -380,6 +381,10 @@ export class AbstractScatter extends Throwable { } } + _removeCallbacks(){ + this.onClose = [] + } + _removeSelfFromScatterContainer() { /** Removes self from container when it's closed. From 1d94455c1ad9ad71174e8beba3b7fd3be8d24273 Mon Sep 17 00:00:00 2001 From: Severin Opel Date: Mon, 12 Aug 2019 16:35:10 +0200 Subject: [PATCH 2/2] Cleanup transform listeners properly now. --- lib/scatter.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/scatter.js b/lib/scatter.js index 3a3efe6..6459140 100644 --- a/lib/scatter.js +++ b/lib/scatter.js @@ -351,6 +351,7 @@ export class AbstractScatter extends Throwable { } close() { + console.log('SCATTER WAS CLOSED!') this._callCloseCallbacks() this._removeCallbacks() this._removeSelfFromScatterContainer() @@ -362,8 +363,9 @@ export class AbstractScatter extends Throwable { } } - _removeCallbacks(){ + _removeCallbacks() { this.onClose = [] + this.onTransform = [] } _removeSelfFromScatterContainer() {