diff options
| author | benoit-germain <bnt.germain@gmail.com> | 2012-08-10 20:49:54 +0300 |
|---|---|---|
| committer | benoit-germain <bnt.germain@gmail.com> | 2012-08-10 20:49:54 +0300 |
| commit | 06856ef8b225208a21abf313aaf51905352c6e9d (patch) | |
| tree | 78816851f134d33b331b91b6617486f1d227089a /src | |
| parent | 32aa7012099d6a4b714aef27ab9dbacbdb728c1f (diff) | |
| download | lanes-06856ef8b225208a21abf313aaf51905352c6e9d.tar.gz lanes-06856ef8b225208a21abf313aaf51905352c6e9d.tar.bz2 lanes-06856ef8b225208a21abf313aaf51905352c6e9d.zip | |
Yet another shutdown crash fix
Perform keeper desinit in two stages, in case the keeper state being closed contains a reference to a linda bound to a previously desinitialized keeper, causing it to be destroyed after its keeper state.
(occurs only for applications using more than one keeper).
Diffstat (limited to 'src')
| -rw-r--r-- | src/keeper.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/keeper.c b/src/keeper.c index 28dc338..4e2beb7 100644 --- a/src/keeper.c +++ b/src/keeper.c | |||
| @@ -66,9 +66,13 @@ static int GNbKeepers = 0; | |||
| 66 | static void atexit_close_keepers(void) | 66 | static void atexit_close_keepers(void) |
| 67 | { | 67 | { |
| 68 | int i; | 68 | int i; |
| 69 | // 2-pass close, in case a keeper holds a reference to a linda bound to another keeoer | ||
| 69 | for( i = 0; i < GNbKeepers; ++ i) | 70 | for( i = 0; i < GNbKeepers; ++ i) |
| 70 | { | 71 | { |
| 71 | lua_close( GKeepers[i].L); | 72 | lua_close( GKeepers[i].L); |
| 73 | } | ||
| 74 | for( i = 0; i < GNbKeepers; ++ i) | ||
| 75 | { | ||
| 72 | GKeepers[i].L = 0; | 76 | GKeepers[i].L = 0; |
| 73 | //assert( GKeepers[i].count == 0); | 77 | //assert( GKeepers[i].count == 0); |
| 74 | MUTEX_FREE( &GKeepers[i].lock_); | 78 | MUTEX_FREE( &GKeepers[i].lock_); |
