Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit 00022bd

Browse files
committed
fix(element binder): fix memory leak with expando value holding onto ...
1 parent 06580cb commit 00022bd

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

lib/core_dom/element_binder.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ class ElementBinder {
318318
nodeInjector = parentInjector.createChild([nodeModule]);
319319
probe = _expando[node] = new ElementProbe(
320320
parentInjector.get(ElementProbe), node, nodeInjector, scope);
321+
scope.on(ScopeEvent.DESTROY).listen((_) {_expando[node] = null;});
321322

322323
_link(nodeInjector, probe, scope, nodeAttrs, formatters);
323324

lib/core_dom/shadow_dom_component_factory.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ class _ComponentFactory implements Function {
142142
shadowInjector = injector.createChild([shadowModule], name: SHADOW_DOM_INJECTOR_NAME);
143143
probe = _expando[shadowDom] = new ElementProbe(
144144
injector.get(ElementProbe), shadowDom, shadowInjector, shadowScope);
145+
shadowScope.on(ScopeEvent.DESTROY).listen((ScopeEvent) {_expando[shadowDom] = null;});
145146
return shadowInjector;
146147
}
147148
}

0 commit comments

Comments
 (0)