Skip to content

Commit

Permalink
Fixed memory leak - State objects had been retained in closures
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Feb 24, 2020
1 parent 189c928 commit 1ae31c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/twelve-tables-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'xstate': patch
---

Fixed memory leak - `State` objects had been retained in closures.
2 changes: 1 addition & 1 deletion packages/core/src/State.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export class State<

Object.defineProperty(this, 'nextEvents', {
get: () => {
return nextEvents(config.configuration);
return nextEvents(this.configuration);
}
});
}
Expand Down

0 comments on commit 1ae31c1

Please sign in to comment.