Skip to content

Commit

Permalink
Remove another check before delete
Browse files Browse the repository at this point in the history
Co-authored-by: Mateusz Jakub Fila <37295697+m-fila@users.noreply.github.com>
  • Loading branch information
jmcarcell and m-fila authored Jun 24, 2024
1 parent 0060a22 commit 14e82ae
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions python/templates/macros/implementations.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,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);
}

Expand Down

0 comments on commit 14e82ae

Please sign in to comment.