Skip to content

Commit

Permalink
fix(core): break reference chain to instance object
Browse files Browse the repository at this point in the history
Reference caused in getContextFactory, and it stored in handlerMetadataStorage in Map, that never be purged
  • Loading branch information
breeeew committed Mar 27, 2024
1 parent ddc1265 commit 6a7f74f
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/core/helpers/context-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,11 @@ export class ContextUtils {
instance?: object,
callback?: Function,
): (args: unknown[]) => ExecutionContextHost {
const contextFactory = (args: unknown[]) => {
const ctx = new ExecutionContextHost(
args,
instance && (instance.constructor as Type<unknown>),
callback,
);
const type = instance && (instance.constructor as Type<unknown>);
return (args: unknown[]) => {
const ctx = new ExecutionContextHost(args, type, callback);
ctx.setType(contextType);
return ctx;
};
return contextFactory;
}
}

0 comments on commit 6a7f74f

Please sign in to comment.