EDITOR: fix disposing models (#1026)

This commit is contained in:
Caldwell
2024-01-10 00:45:31 +01:00
committed by GitHub
parent 82511e5030
commit 6f8a59593a
4 changed files with 19 additions and 23 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ export function Editor({ onMount, onChange }: EditorProps) {
// Unmounting
return () => {
subscription.current?.dispose();
editorRef.current?.getModel()?.dispose();
monaco.editor.getModels().forEach((model) => model.dispose());
editorRef.current?.dispose();
};
// this eslint ignore instruction can potentially cause unobvious bugs