Skip to content

Commit 421f633

Browse files
committed
Remove the references from the context after processing them to free up memory
1 parent 8302467 commit 421f633

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/fast-instantiator.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ class InstantiatorBuilder<T extends IClassModelType<Record<string, IAnyType>, an
102102
for (const resolver of context.referencesToResolve) {
103103
resolver();
104104
}
105+
context.referencesToResolve = null; // cleanup these closures, no need to retain them past construction
105106
106107
return instance;
107108
};

0 commit comments

Comments
 (0)