Make MmapWrapper a little less silly
R=thestig at https://breakpad.appspot.com/527002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1113 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
bd6d0964e7
commit
0513eeca07
1 changed files with 2 additions and 1 deletions
|
@ -117,7 +117,7 @@ class MmapWrapper {
|
||||||
public:
|
public:
|
||||||
MmapWrapper() : is_set_(false) {}
|
MmapWrapper() : is_set_(false) {}
|
||||||
~MmapWrapper() {
|
~MmapWrapper() {
|
||||||
if (base_ != NULL) {
|
if (is_set_ && base_ != NULL) {
|
||||||
assert(size_ > 0);
|
assert(size_ > 0);
|
||||||
munmap(base_, size_);
|
munmap(base_, size_);
|
||||||
}
|
}
|
||||||
|
@ -129,6 +129,7 @@ class MmapWrapper {
|
||||||
}
|
}
|
||||||
void release() {
|
void release() {
|
||||||
assert(is_set_);
|
assert(is_set_);
|
||||||
|
is_set_ = false;
|
||||||
base_ = NULL;
|
base_ = NULL;
|
||||||
size_ = 0;
|
size_ = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue