Eliminate C++ static initializers in nsTouchBar.mm
Categories
(Core :: Widget: Cocoa, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox86 | --- | fixed |
People
(Reporter: mstange, Assigned: mstange)
References
Details
Attachments
(2 files)
nsTouchBar.mm uses C++ static initializers to initialize the global variables ShareScrubberIdentifier
and SearchPopoverIdentifier
: https://searchfox.org/mozilla-central/rev/a0ccd492719b1ad2106f6456549be62a76f45acb/widget/cocoa/nsTouchBar.mm#19-28
Static initializers are worth avoiding in general (I forgot the exact reasoning, but it was something about influencing the read order of the XUL library from disk in a bad way).
However, they're extra worth avoiding if they run code that autoreleases ObjC objects, because no autorelease pool is in place when they run, so any temporary autoreleased objects are leaked. The autoreleases also cause warnings when running with OBJC_DEBUG_MISSING_POOLS=YES LIBDISPATCH_DEBUG_MISSING_POOLS=NO
.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 1•3 years ago
|
||
Assignee | ||
Comment 2•3 years ago
|
||
Depends on D100849
Pushed by mstange@themasta.com: https://hg.mozilla.org/integration/autoland/rev/2aa6b9779822 Remove C++ static initializers for touch bar identifiers. r=spohl https://hg.mozilla.org/integration/autoland/rev/1cba84787974 Add some missing includes to fix non-unified builds. r=spohl
Comment 4•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/2aa6b9779822
https://hg.mozilla.org/mozilla-central/rev/1cba84787974
Description
•