Commit 0ad77f6
committed
fix: destroy lnsocket instances after lightning RPC calls
- wrap `ln_rpc()` socket usage in a `try/finally`
- call `destroy()` after each RPC, with `disconnect()` as a fallback
- prevent leaked WASM/native `lnsocket` allocations from exhausting the Emscripten heap
- fix production crashes like `RuntimeError: Aborted(OOM)` during `LNSocket` creation
Closes: #291 parent 0f039b9 commit 0ad77f6
1 file changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
256 | | - | |
257 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
258 | 266 | | |
259 | 267 | | |
260 | 268 | | |
| |||
0 commit comments