summaryrefslogtreecommitdiff
path: root/src/mem/packet.hh
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@gmail.com>2008-03-24 01:08:02 -0400
committerSteve Reinhardt <stever@gmail.com>2008-03-24 01:08:02 -0400
commit623dd7ed3a66e71e241dc8365c079cb5b42fa918 (patch)
tree3455befd6d7a4639237cad2dbe3111cf2d51bf9e /src/mem/packet.hh
parent93ab43288a75061746701c9d22a355793f330a9c (diff)
downloadgem5-623dd7ed3a66e71e241dc8365c079cb5b42fa918.tar.xz
Delete the Request for a no-response Packet
when the Packet is deleted, since the requester can't possibly do it. --HG-- extra : convert_revision : 8571b144ecb3c70efc06d09faa8b3161fb58352d
Diffstat (limited to 'src/mem/packet.hh')
-rw-r--r--src/mem/packet.hh10
1 files changed, 9 insertions, 1 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