summaryrefslogtreecommitdiff
path: root/src/video/cocoa/cocoa_v.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/video/cocoa/cocoa_v.mm')
-rw-r--r--src/video/cocoa/cocoa_v.mm7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm
index 10f30027b..f02599799 100644
--- a/src/video/cocoa/cocoa_v.mm
+++ b/src/video/cocoa/cocoa_v.mm
@@ -34,6 +34,7 @@
#include "../../window_func.h"
#include "../../window_gui.h"
+#include <array>
#import <sys/param.h> /* for MAXPATHLEN */
/**
@@ -545,13 +546,15 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel
*/
void cocoaSetApplicationBundleDir()
{
+ extern std::array<std::string, NUM_SEARCHPATHS> _searchpaths;
+
char tmp[MAXPATHLEN];
CFAutoRelease<CFURLRef> url(CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle()));
if (CFURLGetFileSystemRepresentation(url.get(), true, (unsigned char*)tmp, MAXPATHLEN)) {
AppendPathSeparator(tmp, lastof(tmp));
- _searchpaths[SP_APPLICATION_BUNDLE_DIR] = stredup(tmp);
+ _searchpaths[SP_APPLICATION_BUNDLE_DIR] = tmp;
} else {
- _searchpaths[SP_APPLICATION_BUNDLE_DIR] = NULL;
+ _searchpaths[SP_APPLICATION_BUNDLE_DIR].clear();
}
}