From 463c4ad31609b8f8bf868096c9b54376eaf1c476 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Fri, 5 Oct 2012 20:27:30 -0600 Subject: [PATCH] Bug 3661: Segmentation fault when using more than 1 worker Previous change to Ipc::Mem::PageStack making variable arrays into dynamically-allocated arrays added an allocate after use bug. --- src/ipc/mem/PageStack.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipc/mem/PageStack.cc b/src/ipc/mem/PageStack.cc index 25d8497507..fea71d272b 100644 --- a/src/ipc/mem/PageStack.cc +++ b/src/ipc/mem/PageStack.cc @@ -20,10 +20,10 @@ Ipc::Mem::PageStack::PageStack(const uint32_t aPoolId, const unsigned int aCapac theSize(theCapacity), theLastReadable(prev(theSize)), theFirstWritable(next(theLastReadable)) { + theItems=new Item[theSize]; // initially, all pages are free for (Offset i = 0; i < theSize; ++i) theItems[i] = i + 1; // skip page number zero to keep numbers positive - theItems=new Item[theSize]; } Ipc::Mem::PageStack::~PageStack() -- 2.47.2