commit 0d6f17afe2089160ddc7ed172798d1b6146d7c04
Author: Stephan Witt <sw...@lyx.org>
Date:   Tue Aug 26 08:22:12 2014 +0200

    More careful NSAutoreleasePool management

diff --git a/src/support/linkback/LinkBackProxy.m 
b/src/support/linkback/LinkBackProxy.m
index 8112b31..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 drain];
-       pool = nil;
+       if (linkBackClient != nil) {
+               [linkBackClient release];
+               linkBackClient = nil;
+       }
+
+       if (pool != nil) {
+               [pool drain];
+               pool = nil;
+       }
 }
 

Reply via email to