Skip to content

Commit

Permalink
fix: memory leak and vite warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
John Jenkins committed Feb 27, 2024
1 parent bc18330 commit 2b87847
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/client/client-task-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const flush = () => {
}
};

export const nextTick = /*@__PURE__*/ (cb: () => void) => promiseResolve().then(cb);
export const nextTick = (cb: () => void) => promiseResolve().then(cb);

export const readTask = /*@__PURE__*/ queueTask(queueDomReads, false);

Expand Down
2 changes: 1 addition & 1 deletion src/hydrate/platform/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const writeTask = (cb: Function) => {
};

const resolved = /*@__PURE__*/ Promise.resolve();
export const nextTick = /*@__PURE__*/ (cb: () => void) => resolved.then(cb);
export const nextTick = (cb: () => void) => resolved.then(cb);

const defaultConsoleError = (e: any) => {
if (e != null) {
Expand Down
3 changes: 3 additions & 0 deletions src/runtime/vdom/vdom-render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,9 @@ render() {
// always reset
relocateNodes.length = 0;
}

// Clear the content ref so we don't create a memory leak
contentRef = undefined;
};

// slot comment debug nodes only created with the `--debug` flag
Expand Down

0 comments on commit 2b87847

Please sign in to comment.