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
65604b51
Commit
65604b51
authored
Sep 12, 2011
by
Amaury Forgeot d'Arc
Browse files
Options
Browse Files
Download
Plain Diff
Merge 3.2: Issue #12483: ctypes: Fix a crash when the destruction of a callback
object triggers the garbage collector.
parents
aa2b442b
bbe46d63
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 @
65604b51
...
...
@@ -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 @
65604b51
...
...
@@ -1274,6 +1274,9 @@ Tools/Demos
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 @
65604b51
...
...
@@ -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