diff --git a/dev/udf_proxy.h b/dev/udf_proxy.h index 7b81d1c2a..a08704906 100644 --- a/dev/udf_proxy.h +++ b/dev/udf_proxy.h @@ -29,7 +29,9 @@ namespace sqlite_orm { struct destruct_only_deleter { template void operator()(UDF* f) const noexcept { - f->~UDF(); + std::allocator allocator; + using traits = std::allocator_traits; + traits::destroy(allocator, f); } }; @@ -41,10 +43,10 @@ namespace sqlite_orm { final_call_fn_t finalAggregateCall; const xdestroy_fn_t udfDeallocate; - // flag whether the UDF has been udfConstructed at `udfHandle`; + // flag whether the UDF has been constructed at `udfHandle`; // necessary for aggregation operations bool udfConstructed; - // pointer to memory for UDF + // pointer to memory space for UDF void* const udfHandle; ~udf_proxy() { diff --git a/include/sqlite_orm/sqlite_orm.h b/include/sqlite_orm/sqlite_orm.h index ab6233fe9..d349e0028 100644 --- a/include/sqlite_orm/sqlite_orm.h +++ b/include/sqlite_orm/sqlite_orm.h @@ -14867,7 +14867,9 @@ namespace sqlite_orm { struct destruct_only_deleter { template void operator()(UDF* f) const noexcept { - f->~UDF(); + std::allocator allocator; + using traits = std::allocator_traits; + traits::destroy(allocator, f); } }; @@ -14879,10 +14881,10 @@ namespace sqlite_orm { final_call_fn_t finalAggregateCall; const xdestroy_fn_t udfDeallocate; - // flag whether the UDF has been udfConstructed at `udfHandle`; + // flag whether the UDF has been constructed at `udfHandle`; // necessary for aggregation operations bool udfConstructed; - // pointer to memory for UDF + // pointer to memory space for UDF void* const udfHandle; ~udf_proxy() {