Skip to content

Commit 50c535d

Browse files
committed
fix(CodeHighlightSketch): handle editor release exception
Add try-catch block around editor release to prevent disposal errors from propagating.
1 parent dc53d5b commit 50c535d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/code/CodeHighlightSketch.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,11 @@ open class CodeHighlightSketch(
376376

377377
override fun dispose() {
378378
editorFragment?.editor?.let {
379-
EditorFactory.getInstance().releaseEditor(it)
379+
try {
380+
EditorFactory.getInstance().releaseEditor(it)
381+
} catch (e: Exception) {
382+
/// ignore
383+
}
380384
}
381385
Disposer.dispose(this)
382386
}

0 commit comments

Comments
 (0)