Skip to content

Commit

Permalink
odb: changing has_destructible_fields to needs_non_default_destructor
Browse files Browse the repository at this point in the history
Signed-off-by: Felipe Garay <[email protected]>
  • Loading branch information
fgaray committed Nov 22, 2023
1 parent 2caf66f commit 23abf18
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/odb/src/codeGenerator/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def get_json_files(directory):

# For fields that we need to free/destroy in the destructor
if field["name"] == '_name' and 'no-destruct' not in field["flags"] or "table" in field:
klass["has_destructible_fields"] = True
klass["needs_non_default_destructor"] = True

klass["fields"] = [field for field in klass["fields"] if "bits" not in field]

Expand Down
2 changes: 1 addition & 1 deletion src/odb/src/codeGenerator/templates/impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ namespace odb {
}
{% endif %}

{% if klass.has_destructible_fields %}
{% if klass.needs_non_default_destructor %}
_{{klass.name}}::~_{{klass.name}}()
{
{% for field in klass.fields %}
Expand Down
2 changes: 1 addition & 1 deletion src/odb/src/codeGenerator/templates/impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ namespace odb {
_{{klass.name}}(_dbDatabase*, const _{{klass.name}}& r);
_{{klass.name}}(_dbDatabase*);

{% if klass.has_destructible_fields %}
{% if klass.needs_non_default_destructor %}
~_{{klass.name}}();
{% else %}
~_{{klass.name}}() = default;
Expand Down

0 comments on commit 23abf18

Please sign in to comment.