diff options
-rw-r--r-- | src/lanes.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lanes.c b/src/lanes.c index 4130b24..75106e9 100644 --- a/src/lanes.c +++ b/src/lanes.c | |||
@@ -2092,15 +2092,13 @@ static THREAD_RETURN_T THREAD_CALLCONV lane_main( void* vs) | |||
2092 | // We're a free-running thread and no-one's there to clean us up. | 2092 | // We're a free-running thread and no-one's there to clean us up. |
2093 | // | 2093 | // |
2094 | lua_close( s->L); | 2094 | lua_close( s->L); |
2095 | s->L = L = 0; | ||
2096 | // debug_name is a pointer to an interned string, that no longer exists when the state is closed | ||
2097 | s->debug_name = "<closed>"; | ||
2098 | 2095 | ||
2099 | lane_cleanup( s); | ||
2100 | MUTEX_LOCK( &s->U->selfdestruct_cs); | 2096 | MUTEX_LOCK( &s->U->selfdestruct_cs); |
2101 | // done with lua_close(), terminal shutdown sequence may proceed | 2097 | // done with lua_close(), terminal shutdown sequence may proceed |
2102 | -- s->U->selfdestructing_count; | 2098 | -- s->U->selfdestructing_count; |
2103 | MUTEX_UNLOCK( &s->U->selfdestruct_cs); | 2099 | MUTEX_UNLOCK( &s->U->selfdestruct_cs); |
2100 | |||
2101 | lane_cleanup( s); // s is freed at this point | ||
2104 | } | 2102 | } |
2105 | else | 2103 | else |
2106 | { | 2104 | { |