python: Fix the reference counting for python events placed on the eventq.

We need to add a reference when an object is put on the C++ queue, and remove
a reference when the object is removed from the queue.  This was not happening
before and caused a memory problem.
This commit is contained in:
Nathan Binkert
2008-11-10 11:51:18 -08:00
parent 1adfe5c7f3
commit 4e02e7c217
5 changed files with 40 additions and 23 deletions

View File

@@ -36,7 +36,7 @@ mainq = internal.event.cvar.mainEventQueue
def create(obj, priority=None):
if priority is None:
priority = internal.event.Event.Default_Pri
return internal.event.PythonEvent(obj, priority)
return PythonEvent(obj, priority)
class Event(PythonEvent):
def __init__(self, priority=None):