fix(change_detection): fix a memory leak

This commit is contained in:
vsavkin 2016-03-08 16:42:22 -08:00 committed by Alex Eagle
parent 5824866a83
commit 128acbb6eb
1 changed files with 1 additions and 29 deletions

View File

@ -73,36 +73,8 @@ export class SimpleChange {
isFirstChange(): boolean { return this.previousValue === ChangeDetectionUtil.uninitialized; } isFirstChange(): boolean { return this.previousValue === ChangeDetectionUtil.uninitialized; }
} }
var _simpleChangesIndex = 0;
var _simpleChanges = [
new SimpleChange(null, null),
new SimpleChange(null, null),
new SimpleChange(null, null),
new SimpleChange(null, null),
new SimpleChange(null, null),
new SimpleChange(null, null),
new SimpleChange(null, null),
new SimpleChange(null, null),
new SimpleChange(null, null),
new SimpleChange(null, null),
new SimpleChange(null, null),
new SimpleChange(null, null),
new SimpleChange(null, null),
new SimpleChange(null, null),
new SimpleChange(null, null),
new SimpleChange(null, null),
new SimpleChange(null, null),
new SimpleChange(null, null),
new SimpleChange(null, null),
new SimpleChange(null, null)
];
function _simpleChange(previousValue, currentValue): SimpleChange { function _simpleChange(previousValue, currentValue): SimpleChange {
var index = _simpleChangesIndex++ % 20; return new SimpleChange(previousValue, currentValue);
var s = _simpleChanges[index];
s.previousValue = previousValue;
s.currentValue = currentValue;
return s;
} }
/* tslint:disable:requireParameterType */ /* tslint:disable:requireParameterType */