Commit 589cbe8d authored by Stefan Behnel's avatar Stefan Behnel

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

parent 36d99d96
...@@ -640,7 +640,7 @@ class GlobalState(object): ...@@ -640,7 +640,7 @@ class GlobalState(object):
if cleanup_level is not None \ if cleanup_level is not None \
and cleanup_level <= Options.generate_cleanup_code: and cleanup_level <= Options.generate_cleanup_code:
cleanup_writer = self.parts['cleanup_globals'] 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 return const
def get_string_const(self, text, py_version=None): 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