Closed icheered closed 1 year ago
Right, the API probably needs improvement then.
In the libapi.mjs I made the constructor async so it took care of connection too, but now the API suggests you can connect/disconnect same instance multiple times.
That's not the case as disconnect runs destructor and frees the C++ instance.
I'm closing this one as it doesn't sound like there is much to be done here for now.
API improvements are always welcome.
Code to reproduce the issue
This is the minimal (Svelte) reproduction:
Steps to reproduce the issue:
Basic
Full
Click connect
Console:
Connecting to camera
Select the camera from the device picker
Console:
Camera picked
Console:
Connected to camera
Click disconnect
Console:
Disconnected from camera
Click connect
Console:
Connecting to camera
Select the camera from the device picker
Console:
Camera picked
Console Error: Bindingerror
Console Error: BindingError (Click for full log)
{ "name": "BindingError", "message": "Cannot use deleted val. handle = 0", "stack": "BindingError: Cannot use deleted val. handle = 0\n at Error.Console Error: Memory access out of bounds
Console Error: RuntimeError: memory access out of bounds (Click for full log)
Uncaught (in promise) RuntimeError: memory access out of bounds at libapi.wasm:0xe8f9d at ret.