From: Kevin Lim Date: Thu, 25 May 2006 18:41:36 +0000 (-0400) Subject: Fix minor memory leak. X-Git-Tag: m5_2.0_beta1~36^2~108^2~6 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=02aa549c9b1fd81be4bb1408cb97b92dc126e360;p=gem5.git Fix minor memory leak. --HG-- extra : convert_revision : aa222dd95d833b16b0f474ec156bd6955c2c54c6 --- diff --git a/cpu/o3/lsq_unit_impl.hh b/cpu/o3/lsq_unit_impl.hh index 7974ddaad..10f2b5572 100644 --- a/cpu/o3/lsq_unit_impl.hh +++ b/cpu/o3/lsq_unit_impl.hh @@ -51,12 +51,18 @@ LSQUnit::StoreCompletionEvent::process() //lsqPtr->removeMSHR(lsqPtr->storeQueue[storeIdx].inst->seqNum); - if (lsqPtr->isSwitchedOut()) + if (lsqPtr->isSwitchedOut()) { + if (wbEvent) + delete wbEvent; + return; + } lsqPtr->cpu->wakeCPU(); - if (wbEvent) + if (wbEvent) { wbEvent->process(); + delete wbEvent; + } lsqPtr->completeStore(storeIdx); }