Commit 11a3e85c authored by Robert Bradshaw's avatar Robert Bradshaw Committed by Stefan Behnel

Use reference rather than pointer for destructor calling.

This avoids the issue with overloaded address-of operators.
parent 8b552322
......@@ -1335,7 +1335,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code.putln("if (p->__weakref__) PyObject_ClearWeakRefs(o);")
for entry in cpp_class_attrs:
code.putln("__Pyx_call_destructor(&p->%s);" % entry.cname)
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,
......
......@@ -245,8 +245,8 @@ typedef struct {
// Work around clang bug http://stackoverflow.com/questions/21847816/c-invoke-nested-template-class-destructor
template<typename T>
void __Pyx_call_destructor(T* x) {
x->~T();
void __Pyx_call_destructor(T& x) {
x.~T();
}
// Used for temporary variables of "reference" type.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment