Destroy backbone model on comm:close

pull/37/head
Sylvain Corlay 12 years ago committed by Sylvain Corlay
parent 5f27bff2da
commit 222dc5fb3e

@ -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.

Loading…
Cancel
Save