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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
5858d358
Commit
5858d358
authored
Sep 23, 2016
by
Robert Bradshaw
Committed by
GitHub
Sep 23, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #507 from SyamGadde/memoryviewleak
Fix refcounts for transposed memoryview slices.
parents
cff4b8eb
b3b95252
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+7
-7
No files found.
Cython/Compiler/ExprNodes.py
View file @
5858d358
...
...
@@ -728,6 +728,8 @@ class ExprNode(Node):
elif
self
.
type
.
is_memoryviewslice
:
code
.
put_xdecref_memoryviewslice
(
self
.
result
(),
have_gil
=
not
self
.
in_nogil_context
)
code
.
putln
(
"%s.memview = NULL;"
%
self
.
result
())
code
.
putln
(
"%s.data = NULL;"
%
self
.
result
())
else
:
# Already done if self.is_temp
self
.
generate_subexpr_disposal_code
(
code
)
...
...
@@ -6655,9 +6657,7 @@ class AttributeNode(ExprNode):
return
code
.
putln
(
"%s = %s;"
%
(
self
.
result
(),
self
.
obj
.
result
()))
if
self
.
obj
.
is_name
or
(
self
.
obj
.
is_attribute
and
self
.
obj
.
is_memslice_transpose
):
code
.
put_incref_memoryviewslice
(
self
.
result
(),
have_gil
=
True
)
code
.
put_incref_memoryviewslice
(
self
.
result
(),
have_gil
=
True
)
T
=
"__pyx_memslice_transpose(&%s) == 0"
code
.
putln
(
code
.
error_goto_if
(
T
%
self
.
result
(),
self
.
pos
))
...
...
@@ -6680,10 +6680,10 @@ class AttributeNode(ExprNode):
def
generate_disposal_code
(
self
,
code
):
if
self
.
is_temp
and
self
.
type
.
is_memoryviewslice
and
self
.
is_memslice_transpose
:
# mirror condition for putting the memview incref here:
if
self
.
obj
.
is_name
or
(
self
.
obj
.
is_attribute
and
self
.
obj
.
is_memslice_transpose
):
code
.
put_xdecref_memoryviewslice
(
self
.
result
(),
have_gil
=
True
)
code
.
put_xdecref_memoryviewslice
(
self
.
result
(),
have_gil
=
True
)
code
.
putln
(
"%s.memview = NULL;"
%
self
.
result
())
code
.
putln
(
"%s.data = NULL;"
%
self
.
result
()
)
else
:
ExprNode
.
generate_disposal_code
(
self
,
code
)
...
...
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