mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 20:43:04 +01:00
Minor correction for Vlad's solution to CORE-4680
This commit is contained in:
parent
c785afe4c4
commit
f7e7c513a1
@ -2353,6 +2353,8 @@ SharedMemoryBase::SharedMemoryBase(const TEXT* filename, ULONG length, IpcObject
|
|||||||
else
|
else
|
||||||
length = header_address[0];
|
length = header_address[0];
|
||||||
|
|
||||||
|
fb_assert(length);
|
||||||
|
|
||||||
// Create the real file mapping object.
|
// Create the real file mapping object.
|
||||||
|
|
||||||
TEXT mapping_name[64]; // enough for int32 as text
|
TEXT mapping_name[64]; // enough for int32 as text
|
||||||
@ -2400,12 +2402,6 @@ SharedMemoryBase::SharedMemoryBase(const TEXT* filename, ULONG length, IpcObject
|
|||||||
|
|
||||||
sh_mem_header = (MemoryHeader*) address;
|
sh_mem_header = (MemoryHeader*) address;
|
||||||
sh_mem_length_mapped = length;
|
sh_mem_length_mapped = length;
|
||||||
|
|
||||||
if (!sh_mem_length_mapped)
|
|
||||||
{
|
|
||||||
(Arg::Gds(isc_random) << "sh_mem_length_mapped is 0").raise();
|
|
||||||
}
|
|
||||||
|
|
||||||
sh_mem_handle = file_handle;
|
sh_mem_handle = file_handle;
|
||||||
sh_mem_object = file_obj;
|
sh_mem_object = file_obj;
|
||||||
sh_mem_interest = event_handle;
|
sh_mem_interest = event_handle;
|
||||||
@ -2426,6 +2422,12 @@ SharedMemoryBase::SharedMemoryBase(const TEXT* filename, ULONG length, IpcObject
|
|||||||
SetEvent(event_handle);
|
SetEvent(event_handle);
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
|
UnmapViewOfFile(address);
|
||||||
|
CloseHandle(file_obj);
|
||||||
|
UnmapViewOfFile(header_address);
|
||||||
|
CloseHandle(header_obj);
|
||||||
|
CloseHandle(event_handle);
|
||||||
|
CloseHandle(file_handle);
|
||||||
system_call_failed::raise("FlushViewOfFile", err);
|
system_call_failed::raise("FlushViewOfFile", err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user