Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
bbe46d63
Commit
bbe46d63
authored
Sep 12, 2011
by
Amaury Forgeot d'Arc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #12483: ctypes: Fix a crash when the destruction of a callback
object triggers the garbage collector.
parent
1d7deafe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
0 deletions
+12
-0
Lib/ctypes/test/test_callbacks.py
Lib/ctypes/test/test_callbacks.py
+8
-0
Misc/NEWS
Misc/NEWS
+3
-0
Modules/_ctypes/callbacks.c
Modules/_ctypes/callbacks.c
+1
-0
No files found.
Lib/ctypes/test/test_callbacks.py
View file @
bbe46d63
...
...
@@ -134,6 +134,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
:
...
...
Misc/NEWS
View file @
bbe46d63
...
...
@@ -65,6 +65,9 @@ Tests
Extension Modules
-----------------
- Issue #12483: ctypes: Fix a crash when the destruction of a callback
object triggers the garbage collector.
- Issue #12950: Fix passing file descriptors in multiprocessing, under
OpenIndiana/Illumos.
...
...
Modules/_ctypes/callbacks.c
View file @
bbe46d63
...
...
@@ -13,6 +13,7 @@ static void
CThunkObject_dealloc
(
PyObject
*
_self
)
{
CThunkObject
*
self
=
(
CThunkObject
*
)
_self
;
PyObject_GC_UnTrack
(
self
);
Py_XDECREF
(
self
->
converters
);
Py_XDECREF
(
self
->
callable
);
Py_XDECREF
(
self
->
restype
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment