Browse Source

[2831] Reset the parent's segment before forking

Though we won't have two readers at the same time, it's best we
reset the segment so that it's not carried over for the child
to use accidentally.
Mukund Sivaraman 12 years ago
parent
commit
3469f1a875
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/lib/util/tests/memory_segment_mapped_unittest.cc

+ 1 - 0
src/lib/util/tests/memory_segment_mapped_unittest.cc

@@ -384,6 +384,7 @@ TEST_F(MemorySegmentMappedTest, multiProcess) {
     ptr = segment_->getNamedAddress("test address");
     ASSERT_TRUE(ptr);
     EXPECT_EQ(424242, *static_cast<const uint32_t*>(ptr));
+    segment_.reset();
 
     // Spawn another process and have it open and read the same data
     int pipes[2];