Skip to content

Commit

Permalink
Call unref on pathRefs created for move_node (#5727)
Browse files Browse the repository at this point in the history
* Call unref on pathRefs created for move_node

* Create old-frogs-run.md

---------

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
  • Loading branch information
hernansartorio and dylans authored Sep 26, 2024
1 parent 01dc30b commit 335c541
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/old-frogs-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'slate-react': patch
---

Call unref on pathRefs created for move_node to remove memory leak
2 changes: 2 additions & 0 deletions packages/slate-react/src/plugin/with-react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ export const withReact = <T extends BaseEditor>(
const [node] = Editor.node(e, pathRef.current)
NODE_TO_KEY.set(node, key)
}

pathRef.unref()
}
}

Expand Down

0 comments on commit 335c541

Please sign in to comment.