Commit 57c82747 authored by Stefan Behnel's avatar Stefan Behnel

use Py_CLEAR() to more safely clean up cached module constants

--HG--
extra : transplant_source : %11%92%D5%D4%BE%D4%EA%28%D4%9E%B4%E7gZ%ECp%A6%8CL%E0
parent 0c117243
......@@ -640,7 +640,7 @@ class GlobalState(object):
if cleanup_level is not None \
and cleanup_level <= Options.generate_cleanup_code:
cleanup_writer = self.parts['cleanup_globals']
cleanup_writer.put_xdecref_clear(const.cname, type, nanny=False)
cleanup_writer.putln('Py_CLEAR(%s);' % const.cname)
return const
def get_string_const(self, text, py_version=None):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment