Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
ce66d553
Commit
ce66d553
authored
Dec 19, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ticket #631: temp leak when deleting slices
parent
13ed9319
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+1
-0
tests/run/delete.pyx
tests/run/delete.pyx
+20
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
ce66d553
...
...
@@ -2605,6 +2605,7 @@ class SliceIndexNode(ExprNode):
self
.
start_code
(),
self
.
stop_code
()))
self
.
generate_subexpr_disposal_code
(
code
)
self
.
free_subexpr_temps
(
code
)
def
generate_slice_guard_code
(
self
,
code
,
target_size
):
if
not
self
.
base
.
type
.
is_array
:
...
...
tests/run/delete.pyx
View file @
ce66d553
...
...
@@ -60,3 +60,23 @@ def del_list_int(L, int i):
"""
del
L
[
i
]
return
L
def
del_temp_slice
(
a
):
"""
>>> class A(object):
... attr = [1,2,3]
>>> a = A()
>>> a.attr
[1, 2, 3]
>>> del_temp_slice(a)
[]
>>> a.attr
[]
>>> del_temp_slice(a)
[]
>>> a.attr
[]
"""
while
a
.
attr
:
del
a
.
attr
[:]
return
a
.
attr
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