summaryrefslogtreecommitdiff
path: root/src/python/swig/pyevent.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/python/swig/pyevent.cc')
-rw-r--r--src/python/swig/pyevent.cc23
1 files changed, 4 insertions, 19 deletions
diff --git a/src/python/swig/pyevent.cc b/src/python/swig/pyevent.cc
index a201e0185..0695ed2d3 100644
--- a/src/python/swig/pyevent.cc
+++ b/src/python/swig/pyevent.cc
@@ -38,15 +38,10 @@ PythonEvent::PythonEvent(PyObject *obj, Priority priority)
{
if (object == NULL)
panic("Passed in invalid object");
-
- Py_INCREF(object);
-
- setFlags(AutoDelete);
}
PythonEvent::~PythonEvent()
{
- Py_DECREF(object);
}
void
@@ -65,6 +60,10 @@ PythonEvent::process()
async_event = true;
async_exception = true;
}
+
+ // Since the object has been removed from the event queue, its
+ // reference count must be decremented.
+ Py_DECREF(object);
}
CountedDrainEvent *
@@ -85,17 +84,3 @@ cleanupCountedDrain(Event *counted_drain)
assert(event->getCount() == 0);
delete event;
}
-
-#if 0
-Event *
-create(PyObject *object, Event::Priority priority)
-{
- return new PythonEvent(object, priority);
-}
-
-void
-destroy(Event *event)
-{
- delete event;
-}
-#endif