Closed Bug 352827 Opened 18 years ago Closed 18 years ago

Appearance pref pane leaks font mapping table on every load

Categories

(Camino Graveyard :: Preferences, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: stuart.morgan+bugzilla, Assigned: stuart.morgan+bugzilla)

Details

(Keywords: fixed1.8.1.1)

Attachments

(1 file)

setupFontRegionPopup is called on every pane load, which creates and retains mRegionMappingTable, but mRegionMappingTable is only released in dealloc. It needs to be released whenever the pane is unloaded, since right now that array and everything in it are leaked.
The problem with this is that we don't actually call |mainViewDidLoad| every time the prefpane is opened (1. Open prefs 2. select a prefpane 3. cmd-w 4. open prefs, |mainViewDidLoad| not called), so if we release every time the prefpane closes, we'll over-release. Perhaps the real solution to that problem is to call |mainViewDidLoad| every time the prefs open, regardless of whether that pane was the last one seen.
As long as you always set member variables to nil when they are released, which you pretty much always should in a non-dealloc method, it's impossible to over-release them (assuming you did in fact have a strong ref). But if the expectation is that the mapping might become stale, it probably should be refreshed on every display (and if that's not the expectation, the map should only be created once).
Attached patch stop leakingSplinter Review
This fixes the leak the direct way. Ideally that data would only exist while the pane is showing, but that's not possible at the moment (filed as bug 358318).
Assignee: nobody → stuart.morgan
Status: NEW → ASSIGNED
Attachment #243750 - Flags: superreview?(mikepinkerton)
Comment on attachment 243750 [details] [diff] [review] stop leaking cute. sr=pink
Attachment #243750 - Flags: superreview?(mikepinkerton) → superreview+
Checked in on 1.8branch and trunk.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Keywords: fixed1.8
Resolution: --- → FIXED
Keywords: fixed1.8fixed1.8.1
Keywords: fixed1.8.1.1
Keywords: fixed1.8.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: