|
|
@@ -57,12 +57,14 @@ namespace entry
|
|
|
|
|
|
int32_t MainThreadEntry::threadFunc(void* _userData)
|
|
|
{
|
|
|
- CFBundleRef mainBundle = CFBundleGetMainBundle();
|
|
|
- CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle);
|
|
|
- char path[PATH_MAX];
|
|
|
- if (CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8 *)path, PATH_MAX))
|
|
|
- chdir(path);
|
|
|
- CFRelease(resourcesURL);
|
|
|
+ CFBundleRef mainBundle = CFBundleGetMainBundle();
|
|
|
+ CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle);
|
|
|
+ char path[PATH_MAX];
|
|
|
+ if (CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8 *)path, PATH_MAX) )
|
|
|
+ {
|
|
|
+ chdir(path);
|
|
|
+ }
|
|
|
+ CFRelease(resourcesURL);
|
|
|
|
|
|
MainThreadEntry* self = (MainThreadEntry*)_userData;
|
|
|
int32_t result = main(self->m_argc, self->m_argv);
|