Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(665)

Unified Diff: base/memory/shared_memory_nacl.cc

Issue 812543002: Update from https://crrev.com/308331 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/memory/shared_memory.h ('k') | base/memory/shared_memory_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/shared_memory_nacl.cc
diff --git a/base/memory/shared_memory_nacl.cc b/base/memory/shared_memory_nacl.cc
index 39625ee65b5087633a6727e9e7515192be227bc3..8435b2ba295c0134b0161968052a4f12685f3cc3 100644
--- a/base/memory/shared_memory_nacl.cc
+++ b/base/memory/shared_memory_nacl.cc
@@ -46,6 +46,7 @@ SharedMemory::SharedMemory(SharedMemoryHandle handle, bool read_only,
}
SharedMemory::~SharedMemory() {
+ Unmap();
Close();
}
@@ -125,7 +126,6 @@ SharedMemoryHandle SharedMemory::handle() const {
}
void SharedMemory::Close() {
- Unmap();
if (mapped_file_ > 0) {
if (close(mapped_file_) < 0)
DPLOG(ERROR) << "close";
@@ -159,8 +159,10 @@ bool SharedMemory::ShareToProcessCommon(ProcessHandle process,
new_handle->fd = new_fd;
new_handle->auto_close = true;
- if (close_self)
+ if (close_self) {
+ Unmap();
Close();
+ }
return true;
}
« no previous file with comments | « base/memory/shared_memory.h ('k') | base/memory/shared_memory_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698