Commit 3c98ade5 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2850] Looks like flush() finalizes base_sgmt_, so we free before that

parent bf30f052
......@@ -137,10 +137,6 @@ struct MemorySegmentMapped::Impl {
reserveMemory();
}
~Impl() {
freeReservedMemory();
}
void reserveMemory() {
if (!read_only_) {
// Reserve a named address for use during setNamedAddress().
......@@ -261,6 +257,7 @@ MemorySegmentMapped::MemorySegmentMapped(const std::string& filename,
MemorySegmentMapped::~MemorySegmentMapped() {
if (impl_->base_sgmt_ && !impl_->read_only_) {
impl_->freeReservedMemory();
impl_->base_sgmt_->flush(); // note: this is exception free
}
delete impl_;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment