mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-06 16:56:45 +08:00
fix(shm_win): Use mem::$delete instead of mem::free in release()
The acquire() function allocates id_info_t using mem::$new<id_info_t>(), so the release() function must use mem::$delete(ii) to deallocate it, not mem::free(ii). This ensures proper allocation/deallocation pairing. Issue: Memory allocated with mem::$new must be freed with mem::$delete to maintain consistent memory management semantics.
This commit is contained in:
parent
b35de5a154
commit
2815fe0163
@ -161,7 +161,7 @@ std::int32_t release(id_t id) noexcept {
|
||||
ipc::error("fail release: invalid id (h = null)\n");
|
||||
}
|
||||
else ::CloseHandle(ii->h_);
|
||||
mem::free(ii);
|
||||
mem::$delete(ii);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user