Skip to content

Commit

Permalink
bpo-38187: Fix reference leak in test_tools (GH-16233)
Browse files Browse the repository at this point in the history
  • Loading branch information
pablogsal committed Sep 17, 2019
1 parent c275312 commit 6fbc924
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Expand Up @@ -15,6 +15,9 @@ class FromFileTests(unittest.TestCase):

_return_read_tsv = ()

def tearDown(self):
Variable._isglobal.instances.clear()

@property
def calls(self):
try:
Expand Down
3 changes: 3 additions & 0 deletions Tools/c-analyzer/c_parser/info.py
Expand Up @@ -22,6 +22,9 @@ class Variable(_NTBase,
__slots__ = ()
_isglobal = util.Slot()

def __del__(self):
del self._isglobal

@classonly
def from_parts(cls, filename, funcname, name, vartype, isglobal=False):
id = info.ID(filename, funcname, name)
Expand Down

0 comments on commit 6fbc924

Please sign in to comment.