| 133 | } |
| 134 | |
| 135 | void |
| 136 | ts_lua_destroy_vm(ts_lua_main_ctx *arr, int n) |
| 137 | { |
| 138 | int i; |
| 139 | lua_State *L; |
| 140 | TSMutex mutexp; |
| 141 | ts_lua_ctx_stats *stats; |
| 142 | |
| 143 | for (i = 0; i < n; i++) { |
| 144 | L = arr[i].lua; |
| 145 | if (L) { |
| 146 | lua_close(L); |
| 147 | arr[i].lua = nullptr; |
| 148 | } |
| 149 | mutexp = arr[i].mutexp; |
| 150 | if (mutexp) { |
| 151 | TSMutexDestroy(mutexp); |
| 152 | arr[i].mutexp = nullptr; |
| 153 | } |
| 154 | |
| 155 | stats = arr[i].stats; |
| 156 | if (stats) { |
| 157 | ts_lua_destroy_ctx_stats(stats); |
| 158 | arr[i].stats = nullptr; |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | return; |
| 163 | } |
| 164 | |
| 165 | lua_State * |
| 166 | ts_lua_new_state() |
no test coverage detected