Skip to content

Commit

Permalink
fix: do not dispose model manually
Browse files Browse the repository at this point in the history
  • Loading branch information
HaydenOrz committed Jan 11, 2024
1 parent 2fc0999 commit 486092d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
3 changes: 0 additions & 3 deletions src/diff.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,7 @@ class MonacoDiffEditor extends React.Component<MonacoDiffEditorProps> {

destroyMonaco() {
if (this.diffEditor) {
const { original, modified } = this.diffEditor.getModel();
this.diffEditor.dispose();
original.dispose();
modified.dispose();
this.subscription?.dispose();
}
}
Expand Down
1 change: 0 additions & 1 deletion src/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ class MonacoEditor extends React.Component<MonacoEditorProps> {

destroyMonaco() {
if (this.editor) {
this.editor?.getModel()?.dispose();
this.editor?.dispose();
this._blurSubscription?.dispose();
this._focusSubscription?.dispose();
Expand Down

0 comments on commit 486092d

Please sign in to comment.