v2
This commit is contained in:
@@ -525,7 +525,13 @@ impl WasmClient {
|
||||
|
||||
impl Drop for WasmClient {
|
||||
fn drop(&mut self) {
|
||||
// Cleanup will be handled by the WebSocket close
|
||||
// Close WebSocket connection if it exists
|
||||
if let Some(ws) = self.websocket.take() {
|
||||
ws.close().unwrap_or_else(|e| {
|
||||
web_sys::console::warn_1(&format!("Failed to close WebSocket: {:?}", e).into());
|
||||
});
|
||||
web_sys::console::log_1(&"🔌 WebSocket connection closed on drop".into());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user