diff --git a/src/odb/src/codeGenerator/gen.py b/src/odb/src/codeGenerator/gen.py index 50de1aa3179..b93b72bc63c 100755 --- a/src/odb/src/codeGenerator/gen.py +++ b/src/odb/src/codeGenerator/gen.py @@ -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] diff --git a/src/odb/src/codeGenerator/templates/impl.cpp b/src/odb/src/codeGenerator/templates/impl.cpp index 60148394f23..59e5b17f0b9 100755 --- a/src/odb/src/codeGenerator/templates/impl.cpp +++ b/src/odb/src/codeGenerator/templates/impl.cpp @@ -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 %} diff --git a/src/odb/src/codeGenerator/templates/impl.h b/src/odb/src/codeGenerator/templates/impl.h index cade01adf53..2d3d34d16df 100755 --- a/src/odb/src/codeGenerator/templates/impl.h +++ b/src/odb/src/codeGenerator/templates/impl.h @@ -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;