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

Bug 751546: Fix "dead object" exception in api-utils/tab/observer. #425

Merged

Conversation

ochameau
Copy link
Contributor

@ochameau ochameau commented May 3, 2012

deactivate was fired too lately.

https://bugzilla.mozilla.org/show_bug.cgi?id=751546

// 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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you need to remove _emit('deactivate', ... it from wherever it was called before ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so as I'm nullifying selectedTab.
deactivate seems to be only fired from here:
https://github.com/ochameau/addon-sdk/blob/9ef15ef357a8fc9776fc25b9a8a9903804b5319f/packages/api-utils/lib/tabs/observer.js#L56

But you should have a better picture of this whole API as you wrote it,
so if you think I should do otherwise, please tell me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's a mess there, but it looks like you're right.

ochameau added a commit that referenced this pull request May 3, 2012
…bject

Bug 751546: Fix "dead object" exception in api-utils/tab/observer. r=@Gozala
@ochameau ochameau merged commit 61165fc into mozilla:master May 3, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants