mirror of
https://github.com/thestk/stk
synced 2026-05-03 04:18:12 +00:00
ensure bundle url is there before making a C string from it
This commit is contained in:
@@ -89,6 +89,7 @@ void Stk :: setRawwavePathForDynamicallyLoadedRawwaves ( void )
|
|||||||
#ifdef __OS_IOS__
|
#ifdef __OS_IOS__
|
||||||
CFBundleRef mainBundle = CFBundleGetMainBundle();
|
CFBundleRef mainBundle = CFBundleGetMainBundle();
|
||||||
CFURLRef url = CFBundleCopyResourceURL(mainBundle, CFSTR("rawwaves"), CFSTR("bundle"), NULL);
|
CFURLRef url = CFBundleCopyResourceURL(mainBundle, CFSTR("rawwaves"), CFSTR("bundle"), NULL);
|
||||||
|
if (url) {
|
||||||
CFStringRef rawwavesPathCFString = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle);
|
CFStringRef rawwavesPathCFString = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle);
|
||||||
CFIndex length = CFStringGetLength(rawwavesPathCFString);
|
CFIndex length = CFStringGetLength(rawwavesPathCFString);
|
||||||
CFIndex maxSize = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8);
|
CFIndex maxSize = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8);
|
||||||
@@ -99,6 +100,7 @@ void Stk :: setRawwavePathForDynamicallyLoadedRawwaves ( void )
|
|||||||
|
|
||||||
CFRelease(url);
|
CFRelease(url);
|
||||||
CFRelease(rawwavesPathCFString);
|
CFRelease(rawwavesPathCFString);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
rawwavesPathSet = true;
|
rawwavesPathSet = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user