[memory linux] Properly unlink shared memory
shm_unlink(name) is the proper way to close a shared memory in linux. Prior to this, xenia was creating and not cleaning up shared memory handle which would accumulate in /dev/shm. shm_unlink is the proper way of doing this. Add filename to CloseFileMappingHandle signature. Add simple test to open and close.
This commit is contained in:
@@ -115,7 +115,7 @@ Memory::~Memory() {
|
||||
// Unmap all views and close mapping.
|
||||
if (mapping_) {
|
||||
UnmapViews();
|
||||
xe::memory::CloseFileMappingHandle(mapping_);
|
||||
xe::memory::CloseFileMappingHandle(mapping_, file_name_);
|
||||
mapping_base_ = nullptr;
|
||||
mapping_ = nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user