Closed Bug 642430 Opened 13 years ago Closed 13 years ago

Pagemod destructor is incomplete

Categories

(Add-on SDK Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ochameau, Unassigned)

Details

Attachments

(1 file)

When we call pagemod.destroy,
we unregister the current pagemod from pagemodmanager register.
It disable the pagemod but does not remove listener it has created!

Here is the code that disable the page mod:
  _onContent: function _onContent(window) {
    if (!pageModManager.has(this))
      return; // not registered yet
A better comment would be "not registered *anymore*"

But we register listeners there:
  _onRuleAdd: function _onRuleAdd(url) {
    pageModManager.on(url, this._onContent);

Without removing them at pagemod destruction.
Attachment #519889 - Flags: review?(myk)
Component: Documentation → General
QA Contact: documentation → general
Attachment #519889 - Flags: review?(myk) → review+
landed:
https://github.com/mozilla/addon-sdk/commit/43b0d6bd86f81fe8a39819912b23e7593b74f67f
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: