Skip to content

Commit

Permalink
perf: fix memory leak caused by invalid destroy (#18)
Browse files Browse the repository at this point in the history
* In src/core/createCodeMirror.ts, onCleanup is modified
* Remove package-lock.json
* In dev/index.ts, Remove 200-rendering test
* In dev/index.ts, Remove 200-rendering test
  • Loading branch information
AsherJingkongChen authored Mar 13, 2023
1 parent 416b5b4 commit c5f2bd8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/createCodeMirror.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ export function createCodeMirror(props?: Partial<CreateCodeMirrorProps>) {
onMount(() => setEditorView(currentView));

onCleanup(() => {
setEditorView(undefined);
editorView()?.destroy();
setEditorView(undefined);
});
})
);
Expand Down
2 changes: 1 addition & 1 deletion src/core/createLazyCompartmentExtension.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Accessor, createEffect, createSignal, lazy } from 'solid-js';
import { Accessor, createEffect, createSignal } from 'solid-js';
import { Extension } from '@codemirror/state';
import { EditorView } from '@codemirror/view';
import { createCompartmentExtension } from './createCompartmentExtension';
Expand Down

0 comments on commit c5f2bd8

Please sign in to comment.