We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b922b30 + 2e229bb commit 066e27bCopy full SHA for 066e27b
js/src/_base/Three.js
@@ -191,6 +191,7 @@ var ThreeModel = widgets.WidgetModel.extend({
191
192
this.on('change', this.onChange, this);
193
this.on('msg:custom', this.onCustomMessage, this);
194
+ this.on('destroy', this.onDestroy, this);
195
196
},
197
@@ -247,6 +248,15 @@ var ThreeModel = widgets.WidgetModel.extend({
247
248
249
constructThreeObject: function() {},
250
251
+ onDestroy: function() {
252
+ if (this.obj) {
253
+ if (this.obj.dispose) {
254
+ this.obj.dispose();
255
+ }
256
+ delete this.obj;
257
258
+ },
259
+
260
261
//
262
// Remote execution of three.js object methods
0 commit comments