Closed Bug 1542944 Opened 5 years ago Closed 5 years ago

nsTouchBar keeps nsITouchBarInputCallbacks alive for too long

Categories

(Core :: Widget: Cocoa, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: mccr8, Assigned: mccr8)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

This appears to be the leak being seen in 1525411. nsTouchBar has a dictionary containing TouchBarInput, which in turn has a field with type nsITouchBarInputCallback. This is implemented in JS. The touch bar isn't torn down until after XPConnect shutdown, or something like that, so we end up leaking nsXPCWrappedJS and a few other things on developer machines that have touch bars.

This is basically a variant of bug 1523944, and adding a loop to releaseJSObjects that sets the callbacks to null seems to fix the leak.

Blocks: 1313429

Could be due to bug 1529366 ?

(In reply to Tim Nguyen :ntim from comment #1)

Could be due to bug 1529366 ?

I did look at that code, but I think the issue dates to the initial touchbar support in bug 1313429.

No longer blocks: 1313429
Regressed by: 1313429
Keywords: regression

I investigated this leak by adding code like this to the XPCWJS ctor and similar code to the dtor:
printf("XPCWJS CREATE %d %p %s\n", getpid(), this, aInfo->Name());
Then I triggered the leak, grepped for this logging in the leaking process, and wrote a little log analyzer to figure out that the leaked items were nsITouchBarInputCallback. Then I audited the uses of this class, and found the use in the touchbar class, which was similar to bug 1523944.

Pushed by amccreight@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/83e7324dc00b
Release nsITouchBarInputCallback earlier so it doesn't leak. r=spohl
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: