Commit bc399f92 authored by gsamain's avatar gsamain

Saner cypclass destructor

parent 0f540140
...@@ -917,7 +917,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -917,7 +917,7 @@ 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() cypclass_attrs = [e for e in scope.var_entries
if e.type.is_cyp_class and not e.name == "this" if e.type.is_cyp_class and not e.name == "this"
and not e.is_type] and not e.is_type]
has_virtual_methods = False has_virtual_methods = False
...@@ -978,8 +978,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -978,8 +978,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
arg_names = [] arg_names = []
generate_cpp_constructor_code(arg_decls, arg_names, is_implementing, py_attrs, constructor) generate_cpp_constructor_code(arg_decls, arg_names, is_implementing, py_attrs, constructor)
if destructor or py_attrs or has_virtual_methods: if type.is_cyp_class or destructor or py_attrs or has_virtual_methods:
if has_virtual_methods: if has_virtual_methods or type.is_cyp_class:
code.put("virtual ") code.put("virtual ")
if is_implementing: if is_implementing:
code.putln("~%s() {" % type.cname) code.putln("~%s() {" % type.cname)
......
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