diff --git a/python/templates/macros/implementations.jinja2 b/python/templates/macros/implementations.jinja2 index 6bac87ae0..fddd1be3e 100644 --- a/python/templates/macros/implementations.jinja2 +++ b/python/templates/macros/implementations.jinja2 @@ -124,9 +124,7 @@ const {{ relation.full_type }} {{ class_type }}::{{ relation.getter_name(get_syn {% set class_type = prefix + class.bare_type %} {% for relation in relations %} void {{ class_type }}::{{ relation.setter_name(get_syntax) }}(const {{ relation.full_type }}& value) { - if (m_obj->m_{{ relation.name }}) { - delete m_obj->m_{{ relation.name }}; - } + delete m_obj->m_{{ relation.name }}; m_obj->m_{{ relation.name }} = new {{ relation.full_type }}(value); }