From c8f808d09529cfcdccad070d5782820309e99770 Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Thu, 3 Nov 2011 15:30:15 +0000 Subject: [Author: thomasvl] Fix memory model by making all the outlets assign not retain. The problem here is UIViewControllers will dump their view in low memory and then reload next time it is needed. So someone hangs on to the localizer for something else, it would keep the views also loaded, so this way the localizer won't keep any of the objects it points to alive via a retain. Note: the AppKit version sorta matches this since outlets aren't retained by default. Clear them in awakeFromNib since that is all they are needed for. R=dmaclach DELTA=19 (9 added, 0 deleted, 10 changed) --- AppKit/GTMUILocalizer.m | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'AppKit') diff --git a/AppKit/GTMUILocalizer.m b/AppKit/GTMUILocalizer.m index ffcc11d..9f252e7 100644 --- a/AppKit/GTMUILocalizer.m +++ b/AppKit/GTMUILocalizer.m @@ -57,6 +57,10 @@ } else { _GTMDevLog(@"Expected an owner_ set for %@", self); } + // Won't need these again, clear them. + owner_ = nil; + otherObjectToLocalize_ = nil; + yetAnotherObjectToLocalize_ = nil; } + (NSBundle *)bundleForOwner:(id)owner { -- cgit v1.2.3