mirror of
https://github.com/OpenVPN/openvpn3.git
synced 2024-09-20 04:02:15 +02:00
ringbuffer.hpp: fix SEH exception in destructor under debugger
When running under debugger, CloseHandle() throws SEH exception when handle is already closed. In this case handle was attempted to close twice - first by destructor of WinEvent and then by destructor of AsioEvent. Fix by assigning duplicated handle to AsioEvent. Reported-By: Anthony Wharton Signed-off-by: Lev Stipakov <lev@openvpn.net>
This commit is contained in:
parent
557ff6249b
commit
6473aeebe6
@ -82,7 +82,11 @@ namespace openvpn
|
||||
|
||||
send_ring_ = (TUN_RING*)MapViewOfFile(send_ring_hmem(), FILE_MAP_ALL_ACCESS, 0, 0, sizeof(TUN_RING));
|
||||
receive_ring_ = (TUN_RING*)MapViewOfFile(receive_ring_hmem(), FILE_MAP_ALL_ACCESS, 0, 0, sizeof(TUN_RING));
|
||||
send_tail_moved_asio_event_.assign(send_ring_tail_moved_());
|
||||
|
||||
HANDLE handle;
|
||||
DuplicateHandle(GetCurrentProcess(), send_ring_tail_moved_(),
|
||||
GetCurrentProcess(), &handle, 0, FALSE, DUPLICATE_SAME_ACCESS);
|
||||
send_tail_moved_asio_event_.assign(handle);
|
||||
}
|
||||
|
||||
RingBuffer(openvpn_io::io_context& io_context,
|
||||
|
Loading…
Reference in New Issue
Block a user