From 67f364396fe570490e45934e708cccb605043406 Mon Sep 17 00:00:00 2001 From: Jonathan Frederic Date: Mon, 18 Nov 2013 20:36:23 +0000 Subject: [PATCH] Properly dispose of widget model. Delete comm's ref to the widget model so the GC will collect it when it is no longer reference elsewhere. --- IPython/html/static/notebook/js/widget.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/IPython/html/static/notebook/js/widget.js b/IPython/html/static/notebook/js/widget.js index 07bb53b02..5e9b8fb70 100644 --- a/IPython/html/static/notebook/js/widget.js +++ b/IPython/html/static/notebook/js/widget.js @@ -84,6 +84,7 @@ define(["components/underscore/underscore-min", view.remove(); } } + delete this.comm.model; // Delete ref so GC will collect widget model. }, @@ -308,6 +309,7 @@ define(["components/underscore/underscore-min", } } that.comm.close(); + delete that.comm.model; // Delete ref so GC will collect widget model. } }); return view;