Closed ExpHP closed 4 years ago
One other final thing:
I noticed that this handle is explicitly cleaned up on failure, while nothing else is. That's when it occurred to me that the reason why new_map
is initialized at the beginning with dummy data (and why the Drop impl checks for null pointers) is that, in these functions, new_map
's drop impl is being used to clean up everything on failure.
However, that means that, in this particular exit branch, I believe CloseHandle
gets called on new_map.map_handle
twice?
https://github.com/elast0ny/shared_memory-rs/blob/749f11db3324afc41d67a8229bbbd059856494a6/src/windows.rs#L63
This is missing a right-shift.