File tree 2 files changed +14
-4
lines changed
2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 3
3
4
4
@implementation SSYDeallocDetector
5
5
6
- #if 0
7
- #warning Logging R&R of Dealloc Detector
6
+ #if 11
7
+ #warning Logging retains, releases and deallocs of Dealloc Detector
8
+ #define LOG_RETAINS_RELEASES_AND_DEALLOCS 1
9
+ #endif
10
+
11
+ #if LOG_RETAINS_RELEASES_AND_DEALLOCS
8
12
- (id )retain {
9
- NSLog(@"75133: Retained SSYDeallocDetector %p", self) ;
13
+ NSLog (@" 75133: Retained SSYDeallocDetector %p " , (__bridge void *) self) ;
10
14
return [super retain ] ;
11
15
}
12
16
13
17
- (oneway void )release {
14
- NSLog(@"75143: Released SSYDeallocDetector %p", self) ;
18
+ NSLog (@" 75143: Released SSYDeallocDetector %p " , (__bridge void *) self) ;
15
19
[super release ] ;
16
20
}
17
21
#endif
@@ -20,9 +24,14 @@ - (void)dealloc {
20
24
[_invocation invoke ] ;
21
25
22
26
[_invocation release ] ;
27
+ #if LOG_RETAINS_RELEASES_AND_DEALLOCS
28
+ NSLog (@" 75153 Deallocced %p " , (__bridge void *)self) ;
29
+ #else
23
30
if (_logMsg) {
24
31
NSLog (@" Deallocced %p %@ " , (__bridge void *)self, _logMsg) ;
25
32
}
33
+ #endif
34
+
26
35
[_logMsg release ] ;
27
36
28
37
[super dealloc ] ;
Original file line number Diff line number Diff line change @@ -590,6 +590,7 @@ + (NSManagedObjectContext*)scratchManagedObjectContext {
590
590
NSAssert (unlikelyError == nil , @" Internal Error 874-4408 %@ " , unlikelyError);
591
591
scratchMOC.persistentStoreCoordinator = scratchPSC;
592
592
[scratchPSC release ];
593
+ [scratchMOC autorelease ];
593
594
594
595
return scratchMOC;
595
596
}
You can’t perform that action at this time.
0 commit comments