diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2011-09-12 18:12:09 (GMT) |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2011-09-12 18:12:09 (GMT) |
commit | 439c25eb9e53fb5b47dd392cccd3a8183e0910eb (patch) | |
tree | 4222f7db271ed1146d3e119a617c8ed4179d89ab /Lib/ctypes/test | |
parent | dcdc3ef5facabec526dff5f78dc3c0b9161184cb (diff) | |
download | cpython-439c25eb9e53fb5b47dd392cccd3a8183e0910eb.zip cpython-439c25eb9e53fb5b47dd392cccd3a8183e0910eb.tar.gz cpython-439c25eb9e53fb5b47dd392cccd3a8183e0910eb.tar.bz2 |
Issue #12483: ctypes: Fix a crash when the destruction of a callback
object triggers the garbage collector.
Diffstat (limited to 'Lib/ctypes/test')
-rw-r--r-- | Lib/ctypes/test/test_callbacks.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/ctypes/test/test_callbacks.py b/Lib/ctypes/test/test_callbacks.py index 621a019..901456d 100644 --- a/Lib/ctypes/test/test_callbacks.py +++ b/Lib/ctypes/test/test_callbacks.py @@ -140,6 +140,14 @@ class Callbacks(unittest.TestCase): if isinstance(x, X)] self.assertEqual(len(live), 0) + def test_issue12483(self): + import gc + class Nasty: + def __del__(self): + gc.collect() + CFUNCTYPE(None)(lambda x=Nasty(): None) + + try: WINFUNCTYPE except NameError: |