Closed Bug 1632759 Opened 4 years ago Closed 4 years ago

Remove unnecessary kungFuDeathGrip in nsObserverService::RemoveObserver

Categories

(Core :: XPCOM, defect)

defect

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: peterv, Assigned: peterv)

Details

Attachments

(1 file)

Timeless completely misdiagnosed the problem in bug 325392 and then applied a generic fix in bug 485834 based on the wrong diagnosis. The problem in bug 325392 was not that we were calling nsObserverService::RemoveObserver from the destructor, and then reentering the destructor. The refcounting code stabilizes the refcount to 1 before calling the destructor to avoid reentering a destructor. The real problem was that we were deleting an XPCOM object manually after creation but without ever holding a strong reference to it, and so not going through the refcount stabilization (and then the destructor can reenter of course).

The generic fix in bug 485834 was based on the spotfix in bug 325392, that was then backed out when the proper fix for that bug landed. I don't think we should keep this kungfuDeathGrip, I ran into it because it causes issues with refcount logging (refcount logging always had an issue with refcounting from a destructor).

Attachment #9142965 - Attachment description: Bug 1632759 - Remove unnecessary kungFuDeathGrip. r?erahm! → Bug 1632759 - Remove unnecessary kungFuDeathGrip. r=erahm
Pushed by pvanderbeken@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7805c1104fa5
Remove unnecessary kungFuDeathGrip. r=erahm
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: