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

bug fix: unloaders can be added after unload has occured #560

Closed
wants to merge 1 commit into from
Closed

bug fix: unloaders can be added after unload has occured #560

wants to merge 1 commit into from

Conversation

erikvold
Copy link
Contributor

Came across this while writing a alternate patch to #559

unloaders can be added after unload has occured, which should not be allowed, and can occur under race conditions like using watchWindows on a opened window that has not yet loaded and disabling the addon before the window completes loading

…d not be allowed, and can occur under race conditions like using watchWindows on a opened window that has not yet loaded and disabling the addon before the window completes loading
@erikvold
Copy link
Contributor Author

One issue is that unload can be triggered multiple times and not just on shutdown.

This could be accomplished by making an array of funcs returned from unload, and calling the funcs in that array. We could also add a undo function which unloads everything currently in the queue, without wiping the queue away.

@erikvold
Copy link
Contributor Author

There is some reason for the race condition in #559 while using listen though, and that may be solvable by some means, but I think a unload function that will immediately call if the unload has already occurred is a good idea regardless.

@Mardak
Copy link
Member

Mardak commented Jul 24, 2011

Some add-ons explicitly call unload() in response to certain user actions that don't include the add-on being disabled such as toolbar customization opening -- usually followed by a re-init of the add-on. This allows a soft reset without completely disabling the add-on and re-enabling it (and if the add-on page happens to be showing in the Add-ons Manager, it doesn't flash disabled then enabled).

@Mardak Mardak closed this Jul 24, 2011
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants