diff options
Diffstat (limited to 'src/lanes.cpp')
-rw-r--r-- | src/lanes.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lanes.cpp b/src/lanes.cpp index c11dd6a..f1b5884 100644 --- a/src/lanes.cpp +++ b/src/lanes.cpp | |||
@@ -333,12 +333,11 @@ LUAG_FUNC(lane_new) | |||
333 | *_ud = lane; // don't forget to store the pointer in the userdata! | 333 | *_ud = lane; // don't forget to store the pointer in the userdata! |
334 | 334 | ||
335 | // Set metatable for the userdata | 335 | // Set metatable for the userdata |
336 | // | ||
337 | lua_pushvalue(L, lua_upvalueindex(1)); // L: ... lane mt | 336 | lua_pushvalue(L, lua_upvalueindex(1)); // L: ... lane mt |
338 | lua_setmetatable(L, -2); // L: ... lane | 337 | lua_setmetatable(L, -2); // L: ... lane |
339 | STACK_CHECK(L, 1); | 338 | STACK_CHECK(L, 1); |
340 | 339 | ||
341 | // Create uservalue for the userdata | 340 | // Create uservalue for the userdata. There can be only one that must be a table, due to Lua 5.1 compatibility. |
342 | // (this is where lane body return values will be stored when the handle is indexed by a numeric key) | 341 | // (this is where lane body return values will be stored when the handle is indexed by a numeric key) |
343 | lua_newtable(L); // L: ... lane {uv} | 342 | lua_newtable(L); // L: ... lane {uv} |
344 | 343 | ||
@@ -349,7 +348,8 @@ LUAG_FUNC(lane_new) | |||
349 | lua_pushvalue(L, _gc_cb_idx); // L: ... lane {uv} k gc_cb | 348 | lua_pushvalue(L, _gc_cb_idx); // L: ... lane {uv} k gc_cb |
350 | lua_rawset(L, -3); // L: ... lane {uv} | 349 | lua_rawset(L, -3); // L: ... lane {uv} |
351 | } | 350 | } |
352 | 351 | STACK_CHECK(L, 2); | |
352 | // store the uservalue in the Lane full userdata | ||
353 | lua_setiuservalue(L, -2, 1); // L: ... lane | 353 | lua_setiuservalue(L, -2, 1); // L: ... lane |
354 | 354 | ||
355 | lua_State* const _L2{ lane->L }; | 355 | lua_State* const _L2{ lane->L }; |