Commit f7cb537
committed
Fix Windows shared memory segment cleanup in shmctl IPC_RMID
Add proper handle cleanup when marking shared memory segment for deletion.
Previously, shmctl(IPC_RMID) only marked the segment by setting key to -1
but did not close the Windows file mapping handle, causing the segment to
persist in the system.
This led to errors when trying to reopen segments with the same key:
- Segment remained accessible via OpenFileMapping()
- But had key = -1, failing validation checks
- Resulted in "Invalid argument" errors
Now properly closes the handle, allowing Windows to destroy the named
mapping object when no processes are attached, matching POSIX semantics
where IPC_RMID marks segment for deletion.
Fixes issue where shmop_open() with 'c' flag fails after shmop_delete().1 parent 04f3226 commit f7cb537
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
823 | 823 | | |
824 | 824 | | |
825 | 825 | | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
826 | 831 | | |
827 | 832 | | |
828 | 833 | | |
| |||
0 commit comments