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
@ -117,7 +117,7 @@ class MmapWrapper {
|
||||
public:
|
||||
MmapWrapper() : is_set_(false) {}
|
||||
~MmapWrapper() {
|
||||
if (base_ != NULL) {
|
||||
if (is_set_ && base_ != NULL) {
|
||||
assert(size_ > 0);
|
||||
munmap(base_, size_);
|
||||
}
|
||||
@ -129,6 +129,7 @@ class MmapWrapper {
|
||||
}
|
||||
void release() {
|
||||
assert(is_set_);
|
||||
is_set_ = false;
|
||||
base_ = NULL;
|
||||
size_ = 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user