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
Gwenaël Samain
cython
Commits
b9cbc3a7
Commit
b9cbc3a7
authored
Mar 19, 2019
by
gsamain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automatically delete cypclass members in cypclass destructor
parent
4a45a634
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+7
-0
No files found.
Cython/Compiler/ModuleNode.py
View file @
b9cbc3a7
...
@@ -917,9 +917,14 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -917,9 +917,14 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
self
.
generate_cyp_class_wrapper_definitions
(
scope
.
sue_entries
,
code
)
self
.
generate_cyp_class_wrapper_definitions
(
scope
.
sue_entries
,
code
)
py_attrs
=
[
e
for
e
in
scope
.
entries
.
values
()
py_attrs
=
[
e
for
e
in
scope
.
entries
.
values
()
if
e
.
type
.
is_pyobject
and
not
e
.
is_inherited
]
if
e
.
type
.
is_pyobject
and
not
e
.
is_inherited
]
cypclass_attrs
=
[
e
for
e
in
scope
.
entries
.
values
()
if
e
.
type
.
is_cyp_class
and
not
e
.
name
==
"this"
and
not
e
.
is_type
]
has_virtual_methods
=
False
has_virtual_methods
=
False
constructor
=
None
constructor
=
None
destructor
=
None
destructor
=
None
if
type
.
is_cyp_class
:
has_virtual_methods
=
True
for
attr
in
scope
.
var_entries
:
for
attr
in
scope
.
var_entries
:
cname
=
attr
.
cname
cname
=
attr
.
cname
if
attr
.
type
.
is_cfunction
and
attr
.
type
.
is_static_method
:
if
attr
.
type
.
is_cfunction
and
attr
.
type
.
is_static_method
:
...
@@ -978,6 +983,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -978,6 +983,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
put
(
"virtual "
)
code
.
put
(
"virtual "
)
if
is_implementing
:
if
is_implementing
:
code
.
putln
(
"~%s() {"
%
type
.
cname
)
code
.
putln
(
"~%s() {"
%
type
.
cname
)
for
cypattr
in
cypclass_attrs
:
code
.
put_cyxdecref
(
cypattr
.
cname
)
if
py_attrs
:
if
py_attrs
:
code
.
put_ensure_gil
()
code
.
put_ensure_gil
()
if
destructor
:
if
destructor
:
...
...
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