From: Stephan Witt Date: Wed, 11 Feb 2015 22:45:57 +0000 (+0100) Subject: #8637 back port of change 0d6f17af: More careful NSAutoreleasePool management X-Git-Tag: 2.1.4~231 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e3a56beab38819c387d1ccf3eafaaa24f72f21e2;p=features.git #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 1e77d94660..0f6b71d664 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; + } }