From e3a56beab38819c387d1ccf3eafaaa24f72f21e2 Mon Sep 17 00:00:00 2001 From: Stephan Witt Date: Wed, 11 Feb 2015 23:45:57 +0100 Subject: [PATCH] #8637 back port of change 0d6f17af: More careful NSAutoreleasePool management --- src/support/linkback/LinkBackProxy.m | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) 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; + } } -- 2.39.5