| 249 | } |
| 250 | |
| 251 | void MemoryFile::doCleanMemoryCache(bool forceClean) { |
| 252 | if (m_ptr) { |
| 253 | UnmapViewOfFile(m_ptr); |
| 254 | m_ptr = nullptr; |
| 255 | } |
| 256 | if (m_fileMapping) { |
| 257 | CloseHandle(m_fileMapping); |
| 258 | m_fileMapping = nullptr; |
| 259 | } |
| 260 | m_diskFile.close(); |
| 261 | } |
| 262 | |
| 263 | bool MemoryFile::openIfNeeded() { |
| 264 | if (!m_diskFile.isFileValid()) { |