Okay, So I am trying to make a callback for my plugin, it seems like fRuntime has expired.
Here it is:
VunglePlugin::DispatchEvent( char const \*event, bool isError ) const { lua\_State \*L = fRuntime.L; // ERROR ON THIS LINE: EXC\_BAD\_ACCESS CoronaLuaNewEvent( L, event ); lua\_pushstring( L, "Vungle" ); lua\_setfield( L, -2, CoronaEventProviderKey() ); lua\_pushboolean( L, isError ); lua\_setfield( L, -2, CoronaEventIsErrorKey() ); CoronaLuaDispatchEvent( L, fListener, 0 ); }
and my delegate:
@implementation VungleDelegate - (id) initWithInstance:(VunglePlugin\*)Instance { self = [super init]; if (self) { m\_handlerInstance = Instance; } return self; } -(void)vungleMoviePlayed:(VGPlayData\*)playData { NSLog( @"VUNGLE - vungleMoviePlayed" ); m\_handlerInstance-\>DispatchEvent( "vungleMoviePlayed", false ); } @end
Everything is fine until the line : lua_State *L = fRuntime.L; where it gives an error.
Does anyone know what i am doing wrong, or how else I can access lu_state.
Thanks!