
July 13, 2004
2:36 a.m.
Jim> The correct way to do this is something like: Jim> tmp = self->foo; Jim> self-> foo = NULL; Jim> Py_XDECREF(tmp); Jim> I suggest that there should be a standard macro to automate this. Jim> Py_CLEAR(self->foo) Jim> This would be defined to be the same result as Py_XDECREF except Jim> that the argument will be set to NULL. Jim> Thoughts? Just my two cents, but the name suggests to me that it's doing more than a simple decref and set to NULL. I can't think of anything else off the top of my head that seems obviously better though. Skip