On Feb 24, 2009, at 12:38 AM, Stefan Behnel wrote:
> Lisandro Dalcin wrote:
>> + for entry in env.default_entries:
>> + if entry.type.is_pyobject and entry.used:
>> - code.putln("Py_DECREF(%s); %s = 0;" % (
>> - code.entry_as_pyobject(entry), entry.cname))
>> + code.put_var_decref_clear(entry)
>>
>> Please revert to my implementation (bare Py_DECREF and nullify), or
>> any other that does not break C compilation... IMHO, The module
>> cleanup function is not a place to play with refnanny. Moreover, the
>> module cleanup funcion is not refnanny-managed...
>
> I agree.
>
>
>> BTW, I believe that cleanup code should be generated when running the
>> testsuite...
>
> I'd even go one step further.
>
> http://trac.cython.org/cython_trac/ticket/218
Note that the cleanup code is not (and cannot) always be safe across
multiple modules. When objects such as interned strings, numerical
literals, etc. are released, the module code becomes unsafe to use
(e.g. even a __del__ method of an object laying around somewhere else.)
- Robert
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev