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.
This commit is contained in:
Jonathan Frederic 2013-11-18 20:36:23 +00:00
parent 296d0e0b31
commit 67f364396f

View File

@ -84,6 +84,7 @@ define(["components/underscore/underscore-min",
view.remove(); 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(); that.comm.close();
delete that.comm.model; // Delete ref so GC will collect widget model.
} }
}); });
return view; return view;