Skip to content

Commit

Permalink
fix: render mutex release error
Browse files Browse the repository at this point in the history
  • Loading branch information
weirongxu committed Sep 3, 2024
1 parent 6ae1269 commit 8edf847
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/view/rendererExplorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ export class RendererExplorer {
) {}

async runQueue<T>(fn: () => Promise<T>): Promise<T> {
let release: undefined | (() => void) = await this.renderMutex.acquire();
let release = (await this.renderMutex.acquire()) as
| undefined
| (() => void);
setTimeout(() => {
if (release) {
release();
Expand All @@ -30,8 +32,10 @@ export class RendererExplorer {
try {
return await fn();
} finally {
release();
release = undefined;
if (release) {
release();
release = undefined;
}
}
}

Expand Down

0 comments on commit 8edf847

Please sign in to comment.