seed icon indicating copy to clipboard operation
seed copied to clipboard

[0.8.x] WebSocket and too early dropped closure

Open wkordalski opened this issue 3 years ago • 0 comments

Commit 08c4ce15255ac8d03df5315796e7b63e624e2987 introduced some bug:

Uncaught Error: closure invoked recursively or destroyed already
    at imports.wbg.__wbindgen_throw
    at wasm_bindgen::throw_str::ha13545fa78d0389b
    at <dyn core::ops::function::Fn<(A,)>+Output = R as wasm_bindgen::closure::WasmClosure>::describe::invoke::he801481bf9a481f4
    at __wbg_adapter_42
    at WebSocket.real

I suppose, one of the unused fields were used to prevent from dropping the closure mentioned above. Rust says the field is unused, because its only use is to run drop() in the right moment. We should mark that field with #[allow(unused)] (or some more specific lint from the "unused" group) instead of removing it.

wkordalski avatar Jul 27 '22 10:07 wkordalski