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
Kirill Smelkov
cython
Commits
d360c927
Commit
d360c927
authored
Feb 18, 2014
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clang-compatible C++ nested destructor call.
parent
5fbe131d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+1
-8
Cython/Utility/ModuleSetupCode.c
Cython/Utility/ModuleSetupCode.c
+8
-0
No files found.
Cython/Compiler/ModuleNode.py
View file @
d360c927
...
...
@@ -1296,14 +1296,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
"if (p->__weakref__) PyObject_ClearWeakRefs(o);"
)
for
entry
in
cpp_class_attrs
:
split_cname
=
entry
.
type
.
cname
.
split
(
'::'
)
destructor_name
=
split_cname
.
pop
()
# Make sure the namespace delimiter was not in a template arg.
while
destructor_name
.
count
(
'<'
)
!=
destructor_name
.
count
(
'>'
):
destructor_name
=
split_cname
.
pop
()
+
'::'
+
destructor_name
destructor_name
=
destructor_name
.
split
(
'<'
,
1
)[
0
]
code
.
putln
(
"p->%s.%s::~%s();"
%
(
entry
.
cname
,
entry
.
type
.
declaration_code
(
""
),
destructor_name
))
code
.
putln
(
"__Pyx_call_destructor(&p->%s);"
%
entry
.
cname
)
for
entry
in
py_attrs
:
code
.
put_xdecref_clear
(
"p->%s"
%
entry
.
cname
,
entry
.
type
,
nanny
=
False
,
...
...
Cython/Utility/ModuleSetupCode.c
View file @
d360c927
...
...
@@ -336,6 +336,14 @@ static CYTHON_INLINE float __PYX_NAN() {
}
#endif
// Work around clang bug http://stackoverflow.com/questions/21847816/c-invoke-nested-template-class-destructor
#ifdef __cplusplus
template
<
typename
T
>
void
__Pyx_call_destructor
(
T
*
x
)
{
x
->~
T
();
}
#endif
/////////////// UtilityFunctionPredeclarations.proto ///////////////
/* unused attribute */
...
...
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