Skip to content

Commit

Permalink
Fix call order when closing sqlite in renderer
Browse files Browse the repository at this point in the history
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
  • Loading branch information
automated-signal and indutny-signal committed Sep 7, 2021
1 parent 4bb002e commit 0815ec7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ts/sql/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,13 @@ async function goBackToMainProcess(): Promise<void> {
window.log.info('data.goBackToMainProcess: switching to main process');

// Close the database in the renderer process.
await close();
const closePromise = close();

// It should be the last query we run in renderer process
shouldUseRendererProcess = false;

await closePromise;

// Print query statistics for whole startup
const entries = Array.from(startupQueries.entries());
startupQueries.clear();
Expand Down

0 comments on commit 0815ec7

Please sign in to comment.