Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
Destroy all tabs when a window is closed (fix #1871)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfrazee committed Dec 8, 2020
1 parent a48373d commit 83247b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/bg/ui/tabs/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,13 @@ export async function remove (win, tab) {
emitReplaceState(win)
}

export async function destroyAll (win) {
for (let t of (activeTabs[win.id] || [])) {
t.destroy()
}
delete activeTabs[win.id]
}

export async function removeAllExcept (win, tab) {
win = getTopWindow(win)
var tabs = getAll(win).slice() // .slice() to duplicate the list
Expand Down
1 change: 1 addition & 0 deletions app/bg/ui/windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ export function createShellWindow (windowState, createOpts = {dontInitPages: fal
for (let k in subwindows) {
subwindows[k].destroy(win)
}
tabManager.destroyAll(win)
})

async function handlePagesReady ({ sender }) {
Expand Down

0 comments on commit 83247b5

Please sign in to comment.