Skip to content

Commit 089383f

Browse files
fix(overmind): memory leaks
1 parent 8e176e7 commit 089383f

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

packages/node_modules/overmind/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,7 @@ export class Overmind<ThisConfig extends IConfiguration>
559559
this.eventHub.emit(EventType.OPERATOR_ASYNC, execution)
560560
result.then(() => {
561561
execution.isRunning = false
562+
mutationTree.dispose()
562563
this.eventHub.emit(EventType.OPERATOR_END, {
563564
...execution,
564565
isAsync: true,
@@ -568,6 +569,7 @@ export class Overmind<ThisConfig extends IConfiguration>
568569
})
569570
} else {
570571
execution.isRunning = false
572+
mutationTree.dispose()
571573
this.eventHub.emit(EventType.OPERATOR_END, {
572574
...execution,
573575
isAsync: false,

packages/node_modules/overmind/src/operator.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ export function createMutationOperator<ThisConfig extends IConfiguration>(
260260
operatorStopped(context, err || value, {
261261
isSkipped: err ? true : options.isSkipped,
262262
})
263+
mutationTree.dispose()
263264
next(err, createContext(context, value))
264265
}
265266

0 commit comments

Comments
 (0)