[Python.NET] Refcount leak in DelegateManager.Dispatcher.TrueDispatch

Greg Chapman glc at well.com
Fri Aug 5 23:15:54 CEST 2005


I'm posting this here because the zope issue tracker seems to be
broken; at least it won't let me in.  Anyway, it looks like there is a
refcount leak in Dispatcher.TrueDispatch when the underlying delegate
has a void return type.  In that case, TrueDispatch returns without
Decrefing the result of the call to the python function which the
Dispatcher is wrapping.  I think the code should be:

if (rtype == typeof(void)) {
    Runtime.Decref(op);       // this line added
    return null;
}

---
Greg Chapman



More information about the PythonDotNet mailing list