diff --git a/include/pocketpy/obj.h b/include/pocketpy/obj.h index e6460d2e..442d26d6 100644 --- a/include/pocketpy/obj.h +++ b/include/pocketpy/obj.h @@ -74,12 +74,7 @@ struct Bytes{ Bytes& operator=(const Bytes& rhs) = delete; std::pair detach() noexcept; - ~Bytes(){ - if(_data != nullptr){ - free(_data); - _data = nullptr; - } - } + ~Bytes(){ delete[] _data;} }; using Super = std::pair;