| 203 | } |
| 204 | |
| 205 | lua_State* ExtensionPoint::QueryParentThread(lua_State* L) |
| 206 | { |
| 207 | lua_State* PL = nullptr; |
| 208 | const int t = lua_gettop(L); |
| 209 | lua_getglobal(L, ExtensionTable.c_str()); |
| 210 | if (lua_istable(L, -1)) |
| 211 | { |
| 212 | lua_getfield(L, -1, "queryParentThread"); |
| 213 | if (lua_isfunction(L, -1)) |
| 214 | { |
| 215 | const auto r = lua_pcall(L, 0, 1, 0); |
| 216 | if (r == LUA_OK) |
| 217 | { |
| 218 | PL = lua_tothread(L, -1); |
| 219 | } |
| 220 | } |
| 221 | } |
| 222 | lua_settop(L, t); |
| 223 | |
| 224 | return PL; |
| 225 | } |
no test coverage detected