Skip to content

Commit

Permalink
Add checks for unregistering message receiver
Browse files Browse the repository at this point in the history
  • Loading branch information
indutny-signal committed May 24, 2021
1 parent e76252d commit 25f4154
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ts/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1840,8 +1840,10 @@ export async function startApp(): Promise<void> {
await messageReceiver.stopProcessing();

await window.waitForAllBatchers();
messageReceiver.unregisterBatchers();
}

if (messageReceiver) {
messageReceiver.unregisterBatchers();
messageReceiver = null;
}

Expand Down Expand Up @@ -3185,8 +3187,10 @@ export async function startApp(): Promise<void> {
await messageReceiver.stopProcessing();

await window.waitForAllBatchers();
messageReceiver.unregisterBatchers();
}

if (messageReceiver) {
messageReceiver.unregisterBatchers();
messageReceiver = null;
}

Expand Down

0 comments on commit 25f4154

Please sign in to comment.