diff --git a/chrome/content/zotero/tabs.js b/chrome/content/zotero/tabs.js index 43d1ad3b25..5eb80b2ea9 100644 --- a/chrome/content/zotero/tabs.js +++ b/chrome/content/zotero/tabs.js @@ -781,6 +781,12 @@ var Zotero_Tabs = new function () { * Close all tabs except the first one */ this.closeAll = function () { + // Ensure a non-loadable tab is selected before bulk-close. Otherwise, + // closing the currently selected tab can auto-select an unloaded tab, + // which triggers lazy-load hooks during shutdown. + if (this._selectedID !== 'zotero-pane') { + this.select('zotero-pane'); + } this.close(this._tabs.slice(1).map(x => x.id)); };