diff options
Diffstat (limited to 'src/lane.cpp')
-rw-r--r-- | src/lane.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/lane.cpp b/src/lane.cpp index 57e3454..7165e85 100644 --- a/src/lane.cpp +++ b/src/lane.cpp | |||
@@ -190,8 +190,7 @@ LUAG_FUNC(thread_join) | |||
190 | LUA_ASSERT(L_, false); | 190 | LUA_ASSERT(L_, false); |
191 | _ret = 0; | 191 | _ret = 0; |
192 | } | 192 | } |
193 | lua_close(_L2); | 193 | _lane->close(); |
194 | _lane->L = nullptr; | ||
195 | STACK_CHECK(L_, _ret); | 194 | STACK_CHECK(L_, _ret); |
196 | return _ret; | 195 | return _ret; |
197 | } | 196 | } |
@@ -683,8 +682,7 @@ static void lane_main(Lane* lane_) | |||
683 | lane_->waiting_on = nullptr; // just in case | 682 | lane_->waiting_on = nullptr; // just in case |
684 | if (selfdestruct_remove(lane_)) { // check and remove (under lock!) | 683 | if (selfdestruct_remove(lane_)) { // check and remove (under lock!) |
685 | // We're a free-running thread and no-one's there to clean us up. | 684 | // We're a free-running thread and no-one's there to clean us up. |
686 | lua_close(lane_->L); | 685 | lane_->close(); |
687 | lane_->L = nullptr; // just in case | ||
688 | lane_->U->selfdestructMutex.lock(); | 686 | lane_->U->selfdestructMutex.lock(); |
689 | // done with lua_close(), terminal shutdown sequence may proceed | 687 | // done with lua_close(), terminal shutdown sequence may proceed |
690 | lane_->U->selfdestructingCount.fetch_sub(1, std::memory_order_release); | 688 | lane_->U->selfdestructingCount.fetch_sub(1, std::memory_order_release); |
@@ -752,9 +750,8 @@ static void lane_main(Lane* lane_) | |||
752 | return 0; | 750 | return 0; |
753 | } else if (_lane->L) { | 751 | } else if (_lane->L) { |
754 | // no longer accessing the Lua VM: we can close right now | 752 | // no longer accessing the Lua VM: we can close right now |
755 | lua_close(_lane->L); | 753 | _lane->close(); |
756 | _lane->L = nullptr; | 754 | // just in case, but _lane will be freed soon so... |
757 | // just in case, but s will be freed soon so... | ||
758 | _lane->debugName = "<gc>"; | 755 | _lane->debugName = "<gc>"; |
759 | } | 756 | } |
760 | 757 | ||