From: Alex Rousskov Date: Wed, 26 Oct 2011 17:17:01 +0000 (-0600) Subject: Remove fake segments from the global Segments array when "unlinking" them. X-Git-Tag: BumpSslServerFirst.take01~75 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=44c64af0d78f88de30264d775accf209e825804b;p=thirdparty%2Fsquid.git Remove fake segments from the global Segments array when "unlinking" them. This change prevents "Duplicate fake segment creation" errors and makes link/unlink code symmetric. Also polished fake Segment destruction code. --- diff --git a/src/ipc/mem/Segment.cc b/src/ipc/mem/Segment.cc index c9bee080ff..ca9f28c133 100644 --- a/src/ipc/mem/Segment.cc +++ b/src/ipc/mem/Segment.cc @@ -212,7 +212,9 @@ Ipc::Mem::Segment::~Segment() { if (doUnlink) { delete [] static_cast(theMem); - debugs(54, 3, HERE << "deleted " << theName << " segment"); + theMem = NULL; + Segments.erase(theName); + debugs(54, 3, HERE << "unlinked " << theName << " fake segment"); } }