Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/ws/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,13 @@ impl Drop for EspWebSocketClient<'_> {
log::warn!("WebSocket close failed during drop: {e:?}");
}

esp!(unsafe { esp_websocket_client_destroy(self.handle) }).unwrap();
// A Drop impl must not panic, especially on panic=abort targets where
// panicking here aborts the whole application. This matches the
// matching esp_websocket_client_close treatment above and extends the
// fix from #648 to the destroy call. See #653.
if let Err(e) = esp!(unsafe { esp_websocket_client_destroy(self.handle) }) {
log::warn!("WebSocket destroy failed during drop: {e:?}");
}

// timeout and callback dropped automatically
}
Expand Down
Loading