systemc: Add an sc_gem5::Port destructor.
authorGabe Black <gabeblack@google.com>
Wed, 3 Oct 2018 23:16:08 +0000 (16:16 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 16 Oct 2018 00:49:23 +0000 (00:49 +0000)
This destructor just removes the port from the list of all ports.

Change-Id: I809b529540c2946d20aeb8d64467d77dc94a7a96
Reviewed-on: https://gem5-review.googlesource.com/c/13288
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

src/systemc/core/port.hh

index 8c09ad0d36eb673967aabf5f43fb998b615aee96..f7b1bbce4ea8759fab6e7bf52f58a9af454c4da6 100644 (file)
@@ -147,6 +147,8 @@ class Port
         allPorts.push_front(this);
     }
 
+    ~Port() { allPorts.remove(this); }
+
     void
     bind(::sc_core::sc_interface *interface)
     {