mirror of
https://github.com/thestk/stk
synced 2026-08-28 04:40:55 +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__
|
||||
CFBundleRef mainBundle = CFBundleGetMainBundle();
|
||||
CFURLRef url = CFBundleCopyResourceURL(mainBundle, CFSTR("rawwaves"), CFSTR("bundle"), NULL);
|
||||
if (url) {
|
||||
CFStringRef rawwavesPathCFString = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle);
|
||||
CFIndex length = CFStringGetLength(rawwavesPathCFString);
|
||||
CFIndex maxSize = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8);
|
||||
@@ -99,6 +100,7 @@ void Stk :: setRawwavePathForDynamicallyLoadedRawwaves ( void )
|
||||
|
||||
CFRelease(url);
|
||||
CFRelease(rawwavesPathCFString);
|
||||
}
|
||||
#endif
|
||||
rawwavesPathSet = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user