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 <[email protected]>
  • Loading branch information
jmcarcell and m-fila committed Jun 24, 2024
1 parent f159465 commit 2ede21f
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 @@ -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);
}

Expand Down

0 comments on commit 2ede21f

Please sign in to comment.