File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed
packages/node_modules/proxy-state-tree/src Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,13 @@ export class MutationTree<T extends object> implements IMutationTree<T> {
7979 dispose ( ) {
8080 this . isTracking = false
8181 this . mutationCallbacks . length = 0
82+
83+ if ( this . proxifier !== this . master . proxifier ) {
84+ this . proxifier . dispose ( )
85+ }
86+
87+ this . proxifier = this . master . proxifier
88+
8289 return this
8390 }
8491}
Original file line number Diff line number Diff line change @@ -85,6 +85,12 @@ export class TrackStateTree<T extends object> implements ITrackStateTree<T> {
8585 this . pathDependencies . clear ( )
8686 this . callback = null
8787
88+ if ( this . proxifier !== this . master . proxifier ) {
89+ this . proxifier . dispose ( )
90+ }
91+
92+ this . proxifier = this . master . proxifier
93+
8894 if ( this . master . currentTree === this ) {
8995 this . master . currentTree = null
9096 }
Original file line number Diff line number Diff line change @@ -124,12 +124,6 @@ export class ProxyStateTree<T extends object> implements IProxyStateTree<T> {
124124 this . cache . mutationTree . push ( tree . dispose ( ) )
125125 } else if ( tree instanceof TrackStateTree ) {
126126 this . cache . trackStateTree . push ( tree . dispose ( ) )
127-
128- if ( tree . proxifier !== this . proxifier ) {
129- tree . proxifier . dispose ( )
130- }
131-
132- tree . proxifier = this . proxifier
133127 }
134128 }
135129 onMutation ( callback : IMutationCallback ) {
You can’t perform that action at this time.
0 commit comments