From 8464e3cdaa1b9b656350df3dc5f4254cbdc2adbc Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Mon, 5 Apr 2010 17:33:46 +0000 Subject: [Author: dmaclach] Subtle issue in GTMLightweightProxy where it would leak (and return nil) if you initialized it using a standard alloc] init] pattern instead if initWithRepresentedObject:]. The init call would go to the proxy which being nil would return nil, and you'd end up with both a leak and a nil pointer nasty. R=thomasvl DELTA=13 (13 added, 0 deleted, 0 changed) --- Foundation/GTMLightweightProxy.m | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Foundation/GTMLightweightProxy.m') diff --git a/Foundation/GTMLightweightProxy.m b/Foundation/GTMLightweightProxy.m index c00e44b..643478a 100644 --- a/Foundation/GTMLightweightProxy.m +++ b/Foundation/GTMLightweightProxy.m @@ -27,6 +27,10 @@ return self; } +- (id)init { + return [self initWithRepresentedObject:nil]; +} + #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 #if GTM_SUPPORT_GC // -[NSProxy finalize] is only in 10.5 or later -- cgit v1.2.3