mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[wpiutil] uv Handle: Use malloc/free instead of new/delete (#3325)
This avoids asan warnings for deleting a different pointer type.
This commit is contained in:
@@ -8,9 +8,9 @@ using namespace wpi::uv;
|
||||
|
||||
Handle::~Handle() noexcept {
|
||||
if (!m_closed && m_uv_handle->type != UV_UNKNOWN_HANDLE) {
|
||||
uv_close(m_uv_handle, [](uv_handle_t* uv_handle) { delete uv_handle; });
|
||||
uv_close(m_uv_handle, [](uv_handle_t* uv_handle) { std::free(uv_handle); });
|
||||
} else {
|
||||
delete m_uv_handle;
|
||||
std::free(m_uv_handle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user