Closed Bug 1570179 Opened 1 year ago Closed 1 year ago

nsXREDirProvider can leak nsLocalFiles in some cases

Categories

(Core :: XPCOM, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: mossop, Assigned: mossop)

Details

Attachments

(1 file)

nsXREDirProvider caches a couple of the lookup results (https://searchfox.org/mozilla-central/rev/38c88cbf4be87dfa0636d15a5d3599a8ea0d1a72/toolkit/xre/nsXREDirProvider.cpp#101). These are cleared during shutdown (https://searchfox.org/mozilla-central/rev/38c88cbf4be87dfa0636d15a5d3599a8ea0d1a72/toolkit/xre/nsXREDirProvider.cpp#1076) but then we trigger various observer notifications to tell quite a lot of other things to shutdown, any of which has the chance to call the directory service which ends up re-caching those results.

It turns out that telemetry is one of those things and so in the right circumstances we pick up an nsLocalFile and nsStringBuffer leak. I don't actually understand why it isn't a problem right now, but a patch I have that does completely irrelevant stuff triggers this.

Assignee: nobody → dtownsend
Pushed by dtownsend@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f2c7c870b120
Clear cached directories after sending shutdown notifications. r=froydnj
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.