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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4