More careful NSAutoreleasePool management

This commit is contained in:
Stephan Witt 2014-08-26 08:22:12 +02:00
parent 4a04328be2
commit 0d6f17afe2

View File

@ -22,18 +22,12 @@ static NSAutoreleasePool * pool = nil;
NSMutableSet * keys;
}
+ (void)load;
- (LyXLinkBackClient *)init;
- (BOOL)edit:(NSString *)fileName;
@end
@implementation LyXLinkBackClient
+ (void)load
{
pool = [[NSAutoreleasePool alloc] init];
}
- (LyXLinkBackClient *)init
{
self = [super init];
@ -233,10 +227,14 @@ int editLinkBackFile(char const * docName)
void closeAllLinkBackLinks()
{
[linkBackClient release];
linkBackClient = nil;
[pool drain];
pool = nil;
if (linkBackClient != nil) {
[linkBackClient release];
linkBackClient = nil;
}
if (pool != nil) {
[pool drain];
pool = nil;
}
}