Oolite 1.91.0.7644-241112-7f5034b
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
15@interface ReleaseLockProxy: NSProxy
16{
17@private
18 id<NSObject> _object;
19 NSString *_name;
20 BOOL _locked;
21}
22
23+ (id)proxyWithObject:(id<NSObject>)object name:(NSString *)name;
24+ (id)proxyWithRetainedObject:(id<NSObject>)object name:(NSString *)name; // Doesn't retain the object
25
26- (id)initWithObject:(id<NSObject>)object name:(NSString *)name;
27- (id)initWithRetainedObject:(id<NSObject>)object name:(NSString *)name; // Doesn't retain the object
28
29- (void)rlpAllowRelease;
30- (NSString *)rlpObjectDescription; // name if not nil, otherwise object description.
31
32@end
id< NSObject > _object