From d12e3d1bc6fa067834af64d7fb0cf99a1950b18b 2014-09-14 15:46:12 From: Sylvain Corlay Date: 2014-09-14 15:46:12 Subject: [PATCH] Destroy backbone model on comm:close --- diff --git a/IPython/html/static/widgets/js/widget.js b/IPython/html/static/widgets/js/widget.js index 8dcda6d..c0272d0 100644 --- a/IPython/html/static/widgets/js/widget.js +++ b/IPython/html/static/widgets/js/widget.js @@ -52,6 +52,7 @@ define(["widgets/js/manager", _handle_comm_closed: function (msg) { // Handle when a widget is closed. this.trigger('comm:close'); + this.comm.model.trigger('destroy', this.comm.model); delete this.comm.model; // Delete ref so GC will collect widget model. delete this.comm; delete this.model_id; // Delete id from model so widget manager cleans up.