summaryrefslogtreecommitdiff
path: root/Cython/Compiler/ModuleNode.py
diff options
context:
space:
mode:
authorRobert Bradshaw <robertwb@gmail.com>2014-02-18 09:30:01 -0800
committerRobert Bradshaw <robertwb@gmail.com>2014-02-18 09:30:01 -0800
commitd360c927d8c2c7027e54b5e600d337f936b3d155 (patch)
treea84820fbfbfa0a68fd8b37c4f3bcf1466cbf4438 /Cython/Compiler/ModuleNode.py
parent5fbe131da6d8b11c2d7a375e8a1b4660c9853c3f (diff)
downloadcython-d360c927d8c2c7027e54b5e600d337f936b3d155.tar.gz
Clang-compatible C++ nested destructor call.
Diffstat (limited to 'Cython/Compiler/ModuleNode.py')
-rw-r--r--Cython/Compiler/ModuleNode.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py
index 251581715..c837c8e3f 100644
--- a/Cython/Compiler/ModuleNode.py
+++ b/Cython/Compiler/ModuleNode.py
@@ -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,