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
82639816
Commit
82639816
authored
Nov 09, 2015
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #25582: Fixed 100 MB memory leak in test_ctypes.
parents
850be0fb
b63902a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
Lib/ctypes/test/test_pointers.py
Lib/ctypes/test/test_pointers.py
+11
-1
Lib/ctypes/test/test_win32.py
Lib/ctypes/test/test_win32.py
+4
-0
No files found.
Lib/ctypes/test/test_pointers.py
View file @
82639816
...
...
@@ -195,9 +195,19 @@ class PointersTestCase(unittest.TestCase):
LargeNamedType
=
type
(
'T'
*
2
**
25
,
(
Structure
,),
{})
self
.
assertTrue
(
POINTER
(
LargeNamedType
))
# to not leak references, we must clean _pointer_type_cache
from
ctypes
import
_pointer_type_cache
del
_pointer_type_cache
[
LargeNamedType
]
def
test_pointer_type_str_name
(
self
):
large_string
=
'T'
*
2
**
25
self
.
assertTrue
(
POINTER
(
large_string
))
P
=
POINTER
(
large_string
)
self
.
assertTrue
(
P
)
# to not leak references, we must clean _pointer_type_cache
from
ctypes
import
_pointer_type_cache
del
_pointer_type_cache
[
id
(
P
)]
if
__name__
==
'__main__'
:
unittest
.
main
()
Lib/ctypes/test/test_win32.py
View file @
82639816
...
...
@@ -135,5 +135,9 @@ class Structures(unittest.TestCase):
self
.
assertEqual
(
ret
.
top
,
top
.
value
)
self
.
assertEqual
(
ret
.
bottom
,
bottom
.
value
)
# to not leak references, we must clean _pointer_type_cache
from
ctypes
import
_pointer_type_cache
del
_pointer_type_cache
[
RECT
]
if
__name__
==
'__main__'
:
unittest
.
main
()
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