Appearance pref pane leaks font mapping table on every load

RESOLVED FIXED

Status

Camino Graveyard
Preferences
RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: Stuart Morgan, Assigned: Stuart Morgan)

Tracking

({fixed1.8.1.1})

Trunk
PowerPC
Mac OS X
fixed1.8.1.1

Details

Attachments

(1 attachment)

699 bytes, patch
Mike Pinkerton (not reading bugmail)
: superreview+
Details | Diff | Splinter Review
(Assignee)

Description

11 years ago
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.

Comment 1

11 years ago
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.
(Assignee)

Comment 2

11 years ago
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).
(Assignee)

Comment 3

11 years ago
Created attachment 243750 [details] [diff] [review]
stop leaking

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+

Comment 5

11 years ago
Checked in on 1.8branch and trunk.
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Keywords: fixed1.8
Resolution: --- → FIXED

Updated

11 years ago
Keywords: fixed1.8 → fixed1.8.1

Updated

11 years ago
Keywords: fixed1.8.1.1

Updated

11 years ago
Keywords: fixed1.8.1
You need to log in before you can comment on or make changes to this bug.