Skip to content

Commit 5daccbe

Browse files
authored
Merge pull request #101 from gadget-inc/cleanup-references
Remove the references from the context after processing them to free up memory
2 parents 8302467 + 421f633 commit 5daccbe

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)