summaryrefslogtreecommitdiff
path: root/src/python/swig/pyevent.hh
diff options
context:
space:
mode:
authorCurtis Dunham <Curtis.Dunham@arm.com>2014-12-23 11:51:40 -0600
committerCurtis Dunham <Curtis.Dunham@arm.com>2014-12-23 11:51:40 -0600
commit10b5e5431d004fe51df30140f20346b2c91248fb (patch)
treeabff13d4c9e7cbcabdf2c5533066fb957fcdfead /src/python/swig/pyevent.hh
parent10c69bb1684c515d683a084b40ab19e5e7ee8c11 (diff)
downloadgem5-10b5e5431d004fe51df30140f20346b2c91248fb.tar.xz
sim: fix reference counting of PythonEvent
When gem5 is a slave to another simulator and the Python is only used to initialize the configuration (and not perform actual simulation), a "debug start" (--debug-start) event will get freed during or immediately after the initial Python frame's execution rather than remaining in the event queue. This tricky patch fixes the GC issue causing this.
Diffstat (limited to 'src/python/swig/pyevent.hh')
-rw-r--r--src/python/swig/pyevent.hh5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/python/swig/pyevent.hh b/src/python/swig/pyevent.hh
index f34fbd996..f668c1d9a 100644
--- a/src/python/swig/pyevent.hh
+++ b/src/python/swig/pyevent.hh
@@ -37,9 +37,10 @@
class PythonEvent : public Event
{
private:
- PyObject *object;
-
+ PyObject *eventCode; // PyObject to call to perform event
public:
+ PyObject *object; // PyObject wrapping this PythonEvent
+
PythonEvent(PyObject *obj, Event::Priority priority);
~PythonEvent();