From 0d6f17afe2089160ddc7ed172798d1b6146d7c04 Mon Sep 17 00:00:00 2001 From: Stephan Witt Date: Tue, 26 Aug 2014 08:22:12 +0200 Subject: [PATCH] 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 8112b313c0..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 drain]; - pool = nil; + if (linkBackClient != nil) { + [linkBackClient release]; + linkBackClient = nil; + } + + if (pool != nil) { + [pool drain]; + pool = nil; + } } -- 2.39.5