commit e3a56beab38819c387d1ccf3eafaaa24f72f21e2
Author: Stephan Witt <[email protected]>
Date: Wed Feb 11 23:45:57 2015 +0100
#8637 back port of change 0d6f17af: More careful NSAutoreleasePool
management
diff --git a/src/support/linkback/LinkBackProxy.m
b/src/support/linkback/LinkBackProxy.m
index 1e77d94..0f6b71d 100644
--- a/src/support/linkback/LinkBackProxy.m
+++ b/src/support/linkback/LinkBackProxy.m
@@ -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 release];
- pool = nil;
+ if (linkBackClient != nil) {
+ [linkBackClient release];
+ linkBackClient = nil;
+ }
+
+ if (pool != nil) {
+ [pool drain];
+ pool = nil;
+ }
}