From 128acbb6ebd86e635399074afbd2a5e68dd72f52 Mon Sep 17 00:00:00 2001 From: vsavkin Date: Tue, 8 Mar 2016 16:42:22 -0800 Subject: [PATCH] fix(change_detection): fix a memory leak --- .../change_detection/change_detection_util.ts | 30 +------------------ 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/modules/angular2/src/core/change_detection/change_detection_util.ts b/modules/angular2/src/core/change_detection/change_detection_util.ts index 67c4fc175c..88c92273b9 100644 --- a/modules/angular2/src/core/change_detection/change_detection_util.ts +++ b/modules/angular2/src/core/change_detection/change_detection_util.ts @@ -73,36 +73,8 @@ export class SimpleChange { 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 { - var index = _simpleChangesIndex++ % 20; - var s = _simpleChanges[index]; - s.previousValue = previousValue; - s.currentValue = currentValue; - return s; + return new SimpleChange(previousValue, currentValue); } /* tslint:disable:requireParameterType */