Skip to content

Commit

Permalink
Fix destructor is not called on an abstract class
Browse files Browse the repository at this point in the history
  • Loading branch information
matusnovak committed May 7, 2023
1 parent a9d73fd commit a864db3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions include/wrenbind17/foreign.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ namespace wrenbind17 {
public:
ForeignKlassImpl(std::string name) : ForeignKlass(std::move(name)) {
allocators.allocate = nullptr;
allocators.finalize = nullptr;
allocators.finalize = &detail::ForeignKlassAllocator<T>::finalize;
}

~ForeignKlassImpl() = default;
Expand Down Expand Up @@ -462,7 +462,6 @@ namespace wrenbind17 {
*/
template <typename... Args> void ctor(const std::string& name = "new") {
allocators.allocate = &detail::ForeignKlassAllocator<T, Args...>::allocate;
allocators.finalize = &detail::ForeignKlassAllocator<T, Args...>::finalize;
std::stringstream ss;
ss << "construct " << name << " (";
constexpr auto n = sizeof...(Args);
Expand Down

0 comments on commit a864db3

Please sign in to comment.