From b8b42a84144c43e157c2629dd19167066bb14a6e Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Tue, 28 Nov 2023 23:48:42 +0800 Subject: [PATCH] some fix --- include/pocketpy/obj.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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;