summaryrefslogtreecommitdiff
path: root/src/mem
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem')
-rw-r--r--src/mem/packet.hh10
-rw-r--r--src/mem/tport.cc1
2 files changed, 9 insertions, 2 deletions
diff --git a/src/mem/packet.hh b/src/mem/packet.hh
index 7aad9de98..a278a3945 100644
--- a/src/mem/packet.hh
+++ b/src/mem/packet.hh
@@ -455,7 +455,15 @@ class Packet : public FastAlloc, public Printable
/** Destructor. */
~Packet()
- { if (staticData || dynamicData) deleteData(); }
+ {
+ // If this is a request packet for which there's no response,
+ // delete the request object here, since the requester will
+ // never get the chance.
+ if (req && isRequest() && !needsResponse())
+ delete req;
+ if (staticData || dynamicData)
+ deleteData();
+ }
/** Reinitialize packet address and size from the associated
* Request object, and reset other fields that may have been
diff --git a/src/mem/tport.cc b/src/mem/tport.cc
index 9fa27046b..ad5e95909 100644
--- a/src/mem/tport.cc
+++ b/src/mem/tport.cc
@@ -83,7 +83,6 @@ SimpleTimingPort::recvTiming(PacketPtr pkt)
assert(pkt->isResponse());
schedSendTiming(pkt, curTick + latency);
} else {
- delete pkt->req;
delete pkt;
}