You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug native.showAlert called in coroutine, cant call a listener callback.
Seems like it happens with other functions, i found https://forums.solar2d.com/t/bug-in-native-showalert-callback/318051 which report the same issue with network.setStatusListener on MacOS.
To Reproduce
put in main.lua to minimal reproduce:
That LuaResource( ... ) bit is trying to pull the function off the wrong stack, after it grabs the main Lua state. (I don't know what the motivation for doing that is, off-hand.)
Temporarily copying the function onto the main state's stack seems to work. Tested with this replacement code:
LuaContext *ctx = LuaContext::GetContext( L );
if ( ctx->L() != L )
{
lua_pushvalue( L, callbackIndex );
lua_xmove( L, ctx->L(), 1 );
callbackIndex = -1;
}
resource = Rtt_NEW( & platform.GetAllocator(), LuaResource( ctx->LuaState(), callbackIndex ) );
if ( ctx->L() != L )
{
lua_pop( ctx->L(), 1 );
}
Describe the bug
native.showAlert
called in coroutine, cant call a listener callback.Seems like it happens with other functions, i found https://forums.solar2d.com/t/bug-in-native-showalert-callback/318051 which report the same issue with
network.setStatusListener
on MacOS.To Reproduce
put in
main.lua
to minimal reproduce:Target platform and where build was made:
On Android 13 (DokeOS 4.0, live build) - nothing happens, callback just not called
Windows 10 22H2, Simulator: runtime error, with no info.
whole test project or build.settings
Just empty project, with
main.lua
, nobuild.settings
The text was updated successfully, but these errors were encountered: