From 848361e8c3031d83cc776231f154c11ec6c19d67 Mon Sep 17 00:00:00 2001 From: James Baird Date: Fri, 6 Feb 2015 10:15:55 -0800 Subject: [PATCH] [fixed] Clean up mounted route component on unmount so we don't leak references --- modules/RouteHandlerMixin.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/RouteHandlerMixin.js b/modules/RouteHandlerMixin.js index 0c4f92d374..e2f6d7c3d4 100644 --- a/modules/RouteHandlerMixin.js +++ b/modules/RouteHandlerMixin.js @@ -30,6 +30,10 @@ var RouteHandlerMixin = { this._updateRouteComponent(); }, + componentWillUnmount: function () { + this.context.setRouteComponentAtDepth(this.getRouteDepth(), null); + }, + _updateRouteComponent: function () { this.context.setRouteComponentAtDepth(this.getRouteDepth(), this.refs[REF_NAME]); },