aboutsummaryrefslogtreecommitdiff
path: root/Foundation/GTMLightweightProxy.m
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2010-04-05 17:33:46 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2010-04-05 17:33:46 +0000
commit8464e3cdaa1b9b656350df3dc5f4254cbdc2adbc (patch)
treefab7c2f46696be18bcf902439ca2b4ec6e3364e0 /Foundation/GTMLightweightProxy.m
parent749900bde6560d275418871bff922df9cf1e9643 (diff)
[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)
Diffstat (limited to 'Foundation/GTMLightweightProxy.m')
-rw-r--r--Foundation/GTMLightweightProxy.m4
1 files changed, 4 insertions, 0 deletions
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