mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-22 23:23:54 +08:00
Sentry fix: race condition can cause finalize to be called after captureWindow destroyed
This commit is contained in:
parent
3994c6e67f
commit
acfe38e485
1 changed files with 4 additions and 4 deletions
|
@ -323,7 +323,9 @@ function _generateNextCrossplatformPreview() {
|
|||
|
||||
onFinalize = success => {
|
||||
clearTimeout(timer);
|
||||
captureWindow.removeListener('page-title-updated', onRendererSuccess);
|
||||
if (captureWindow) {
|
||||
captureWindow.removeListener('page-title-updated', onRendererSuccess);
|
||||
}
|
||||
process.nextTick(_generateNextCrossplatformPreview);
|
||||
resolve(success);
|
||||
};
|
||||
|
@ -336,9 +338,7 @@ async function _generateQuicklookPreview({ filePath }: { filePath: string }) {
|
|||
const pathQuoted = `"${filePath.replace(/"/g, '\\"')}"`;
|
||||
|
||||
return new Promise(resolve => {
|
||||
const cmd = `qlmanage -t -f ${
|
||||
window.devicePixelRatio
|
||||
} -s ${ThumbnailWidth} -o ${dirQuoted} ${pathQuoted}`;
|
||||
const cmd = `qlmanage -t -f ${window.devicePixelRatio} -s ${ThumbnailWidth} -o ${dirQuoted} ${pathQuoted}`;
|
||||
|
||||
exec(cmd, (error, stdout, stderr) => {
|
||||
// Note: sometimes qlmanage outputs to stderr but still successfully
|
||||
|
|
Loading…
Reference in a new issue