diff --git a/electron/fragments.ts b/electron/fragments.ts index 98c6d84..fa2ad0b 100644 --- a/electron/fragments.ts +++ b/electron/fragments.ts @@ -639,7 +639,15 @@ async function captureStart( id, w: size.width, h: size.height, data: image.getBitmap() }) }) - await win.loadURL(url) + try { + await win.loadURL(url) + } catch (err) { + // a failed load must not leave a live, continuously-painting window behind: + // captures.has(id) short-circuits every future start for this id, so an + // orphan here is unrecoverable without restarting the app + captureStop(id) + throw err + } } function captureStop(id: string) {