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).
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).
Comment on attachment 243750 [details] [diff] [review] stop leaking cute. sr=pink
Checked in on 1.8branch and trunk.