Closed Bug 770172 Opened 13 years ago Closed 13 years ago

Assertion in unregisterIdleObserver when removing an idle observer that has never been added

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 770171

People

(Reporter: vingtetun, Assigned: bsurender)

References

Details

http://mxr.mozilla.org/mozilla-central/source/dom/base/nsGlobalWindow.cpp#8787 If in debug mode you call removeIdleObserver(fooObserver) but no observer add been added before, you hit an assertion. I wonder if this is expected for an API that will be exposed to the web?
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
(In reply to Vivien Nicolas (:vingtetun) from comment #0) > http://mxr.mozilla.org/mozilla-central/source/dom/base/nsGlobalWindow. > cpp#8787 > > If in debug mode you call removeIdleObserver(fooObserver) but no observer > add been added before, you hit an assertion. > > I wonder if this is expected for an API that will be exposed to the web? If you call removeIdleObserver(fooObserver) but no idle observers have been added before then the removeIdleObserver will just print a warning andreturn NS_OK. The assertion is because the front end dev does something with the window, after Cleanp() and/or FreeInnerObjects() have been called in nsGlobalWindow. These set the idle timer to null and then when the dev calls removeIdleObserver() it hits the idle timer null checker moz assert. This has been corrected. Patch under review.
Assignee: nobody → bsurender
(In reply to bsurender from comment #2) > (In reply to Vivien Nicolas (:vingtetun) from comment #0) > > http://mxr.mozilla.org/mozilla-central/source/dom/base/nsGlobalWindow. > > cpp#8787 > > > > If in debug mode you call removeIdleObserver(fooObserver) but no observer > > add been added before, you hit an assertion. > > > > I wonder if this is expected for an API that will be exposed to the web? > > If you call removeIdleObserver(fooObserver) but no idle observers have been > added before then the removeIdleObserver will just print a warning and return > NS_OK. > > The assertion is because the front end dev does something with the window, > after Cleanp() and/or FreeInnerObjects() have been called in nsGlobalWindow. > These set the idle timer to null and then when the dev calls > removeIdleObserver() it hits the idle timer null checker moz assert. This > has been corrected. Patch under review. You're right. The assertion can also happen if no idle observers have been added but the idle observer but an idle observer is being removed. I have now corrected this.
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.