diff options
Diffstat (limited to 'c')
-rw-r--r-- | c/data.h | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -117,12 +117,16 @@ struct FileView cbMap.QuadPart = c*sizeof(T); hm = CreateFileMapping(hf, nullptr, PAGE_READWRITE, cbMap.HighPart, cbMap.LowPart, nullptr); - if (!hm) + if (!hm) { + CloseHandle(hf); throw Win32Error(); + } view = reinterpret_cast<T*>(MapViewOfFile(hm, FILE_MAP_ALL_ACCESS, 0, 0, 0)); - if (!view) + if (!view) { + CloseHandle(hm); throw Win32Error(); + } } ~FileView() |