mirror of
https://github.com/Tencent/MMKV.git
synced 2026-10-17 04:30:56 +08:00
dont depend on OS close() to unlock file locks, for Linux/Android flock() is buggy with mmap()
This commit is contained in:
@@ -78,7 +78,7 @@ MemoryFile::MemoryFile(string path, size_t size, FileType fileType, size_t expec
|
||||
} else {
|
||||
if (m_diskFile.isFileValid()) {
|
||||
m_size = m_diskFile.m_size;
|
||||
mmapOrCleanup();
|
||||
mmapOrCleanup(nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -91,7 +91,7 @@ MemoryFile::MemoryFile(int ashmemFD)
|
||||
} else {
|
||||
m_size = m_diskFile.m_size;
|
||||
MMKVInfo("ashmem name:%s, size:%zu", m_diskFile.m_path.c_str(), m_size);
|
||||
mmapOrCleanup();
|
||||
mmapOrCleanup(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user