Oolite
Loading...
Searching...
No Matches
ReleaseLockProxy.h
Go to the documentation of this file.
1/* ReleaseLockProxy.h
2 By Jens Ayton
3 This code is hereby placed in the public domain.
4
5 Hacky debug utility.
6 A ReleaseLockProxy proxies an object, and stops the proxied object from
7 being released until -rlpAllowRelease is called. All releases are logged,
8 and one that would cause the object to die is stopped. Breakpoints in
9 release may be handy.
10*/
11
12#import <Foundation/Foundation.h>
13
14@interface ReleaseLockProxy : NSProxy {
15@private
16 id<NSObject> _object;
17 NSString* _name;
18 BOOL _locked;
19}
20
21+ (id)proxyWithObject:(id<NSObject>)object name:(NSString*)name;
22+ (id)proxyWithRetainedObject:(id<NSObject>)object name:(NSString*)name; // Doesn't retain the object
23
24- (id)initWithObject:(id<NSObject>)object name:(NSString*)name;
25- (id)initWithRetainedObject:(id<NSObject>)object name:(NSString*)name; // Doesn't retain the object
26
27- (void)rlpAllowRelease;
28- (NSString*)rlpObjectDescription; // name if not nil, otherwise object description.
29
30@end
id< NSObject > _object