Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #425 from ochameau/bug/751546-fix-tab-utils-dead-o…

…bject

Bug 751546: Fix "dead object" exception in api-utils/tab/observer. r=@gozala
  • Loading branch information...
commit 61165fc1fde222fb342326a2fe4ec2aac1014f96 2 parents 35cf82a + 9ef15ef
@ochameau ochameau authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 packages/api-utils/lib/tabs/observer.js
View
6 packages/api-utils/lib/tabs/observer.js
@@ -71,6 +71,12 @@ windowObserver.on("open", onWindowOpen);
function onWindowClose(chromeWindow) {
if (!isBrowser(chromeWindow)) return; // Ignore if it's not a browser window.
+ // Bug 751546: Emit `deactivate` event on window close immediatly
+ // Otherwise we are going to face "dead object" exception on `select` event
+ if (getActiveTab(chromeWindow) == selectedTab) {
+ observer._emit("deactivate", selectedTab);
+ selectedTab = null;
+ }
getTabContainers(chromeWindow).forEach(function (container) {
observer.ignore(container);
});
Please sign in to comment.
Something went wrong with that request. Please try again.