| 185 | } |
| 186 | |
| 187 | function makeMutClosure(arg0, arg1, dtor, f) { |
| 188 | const state = { a: arg0, b: arg1, cnt: 1 }; |
| 189 | const real = (...args) => { |
| 190 | // First up with a closure we increment the internal reference |
| 191 | // count. This ensures that the Rust closure environment won't |
| 192 | // be deallocated while we're invoking it. |
| 193 | state.cnt++; |
| 194 | const a = state.a; |
| 195 | state.a = 0; |
| 196 | try { |
| 197 | return f(a, state.b, ...args); |
| 198 | } finally { |
| 199 | if (--state.cnt === 0) { |
| 200 | dtor(a, state.b); |
| 201 | |
| 202 | } else { |
| 203 | state.a = a; |
| 204 | } |
| 205 | } |
| 206 | }; |
| 207 | real.original = state; |
| 208 | |
| 209 | return real; |
| 210 | } |
| 211 | function __wbg_adapter_20(arg0, arg1, arg2) { |
| 212 | wasm.wasm_bindgen__convert__closures__invoke1_mut(arg0, arg1, addHeapObject(arg2)); |
| 213 | } |