Created
February 27, 2022 01:04
-
-
Save cmsj/ff64a2267c8017d6447b741848be07da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int camera_isinuse(lua_State *L) { | |
LuaSkin *skin = [LuaSkin sharedWithState:L]; | |
[skin checkArgs:LS_TUSERDATA, USERDATA_TAG, LS_TBREAK]; | |
HSCamera *camera = [skin toNSObjectAtIndex:1]; | |
// This was the original code here, crashed every time | |
// lua_pushboolean(skin.L, camera.isInUse); | |
// return 1; | |
// This is the new code here, and even this crashes without NSLog() | |
NSLog(@"Camera: %@", camera); | |
NSNumber *isInUse = [NSNumber numberWithBool:camera.isInUse]; | |
[skin pushNSObject:isInUse]; | |
return 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment