diff --git a/CHANGELOG.md b/CHANGELOG.md index 906d453..e7df2ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ### Versions +## 4.0.1 +###### *Jan 18, 2021* + +- Editor: dispose the current model if the Editor component is unmounted + ## 4.0.0 ###### *Jan 16, 2021* diff --git a/package.json b/package.json index 82d3ba4..586119e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@monaco-editor/react", - "version": "4.0.0", + "version": "4.0.1", "description": "Monaco editor wrapper for easy/one-line integration with React applications (e.g. powered by create-react-app) without need of webpack configuration files", "author": "Suren Atoyan ", "main": "lib/cjs/index.js", diff --git a/src/Editor/Editor.js b/src/Editor/Editor.js index 30ef4aa..2165a10 100644 --- a/src/Editor/Editor.js +++ b/src/Editor/Editor.js @@ -171,6 +171,7 @@ function Editor({ function disposeEditor() { subscriptionRef.current?.dispose(); + editorRef.current.getModel()?.dispose(); editorRef.current.dispose(); }