mirror of https://github.com/bjornbytes/lovr.git
Actually fix/test the issue with .lovr files on macOS apps;
This commit is contained in:
parent
f6cd8120ad
commit
c3f91e9ff3
|
@ -48,15 +48,16 @@ static bool getBundlePath(char* buffer, size_t size) {
|
|||
id extension = objc_msgSend((id) objc_getClass("NSString"), sel_registerName("stringWithUTF8String:"), "lovr");
|
||||
id bundle = objc_msgSend((id) objc_getClass("NSBundle"), sel_registerName("mainBundle"));
|
||||
id path = objc_msgSend(bundle, sel_registerName("pathForResource:ofType:"), nil, extension);
|
||||
|
||||
if (path == nil) {
|
||||
return false;
|
||||
}
|
||||
|
||||
char* cpath = NULL;
|
||||
object_getInstanceVariable(path, "UTF8String", (void**) &cpath);
|
||||
size_t length = strlen(cpath);
|
||||
const char* cpath = (const char*) objc_msgSend(path, sel_registerName("UTF8String"));
|
||||
if (!cpath) {
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t length = strlen(cpath);
|
||||
if (length >= size) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue