summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2020-05-31 21:19:15 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2020-05-31 21:19:26 +0200
commit897b903f163b5d745afe8c8df92c8609f9ea51b5 (patch)
tree3e91bd1e597199c2c679a7b83c2e247a64de742d
parent99570633985d0e1d081737e7643cd6b478e02628 (diff)
Have NSAutoreleasePool released after last use of variable e
-rw-r--r--src/Fl_cocoa.mm4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index b15ec3692..d368d036d 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -4443,12 +4443,11 @@ char *Fl_Darwin_System_Driver::preference_rootnode(Fl_Preferences *prefs, Fl_Pre
// If we ever port this to iOS: NSHomeDirectory returns tha location of the app!
const char *e = ::getenv("HOME");
// if $HOME does not exist, try NSHomeDirectory, the Mac way.
+ NSAutoreleasePool *localPool = [[NSAutoreleasePool alloc] init];
if ( (e==0L) || (e[0]==0) || (::access(e, F_OK)==-1) ) {
- NSAutoreleasePool *localPool = [[NSAutoreleasePool alloc] init];
NSString *nsHome = NSHomeDirectory();
if (nsHome)
e = [nsHome UTF8String];
- [localPool release];
}
// if NSHomeDirectory does not work, try getpwuid(), the Unix way.
if ( (e==0L) || (e[0]==0) || (::access(e, F_OK)==-1) ) {
@@ -4456,6 +4455,7 @@ char *Fl_Darwin_System_Driver::preference_rootnode(Fl_Preferences *prefs, Fl_Pre
e = pw->pw_dir;
}
snprintf(filename, FL_PATH_MAX, "%s/Library/Preferences", e);
+ [localPool release];
break; }
}