diff options
author | Benoit Germain <bnt period germain arrobase gmail period com> | 2014-02-28 11:21:42 +0100 |
---|---|---|
committer | Benoit Germain <bnt period germain arrobase gmail period com> | 2014-02-28 11:21:42 +0100 |
commit | 9e55f96ac685929a11681b9c98710c94eeb2e18a (patch) | |
tree | 2aac383658ac3806c0eb10644ec5ced1c6a23b39 | |
parent | 437759ddf0ce7e6dc5ed4944e033ef04674de430 (diff) | |
download | lanes-9e55f96ac685929a11681b9c98710c94eeb2e18a.tar.gz lanes-9e55f96ac685929a11681b9c98710c94eeb2e18a.tar.bz2 lanes-9e55f96ac685929a11681b9c98710c94eeb2e18a.zip |
Fix a lane close crash
-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 | { |