blueloveTH пре 2 година
родитељ
комит
b8b42a8414
1 измењених фајлова са 1 додато и 6 уклоњено
  1. 1 6
      include/pocketpy/obj.h

+ 1 - 6
include/pocketpy/obj.h

@@ -74,12 +74,7 @@ struct Bytes{
     Bytes& operator=(const Bytes& rhs) = delete;
     std::pair<unsigned char*, int> detach() noexcept;
 
-    ~Bytes(){
-        if(_data != nullptr){
-            free(_data);
-            _data = nullptr;
-        }
-    }
+    ~Bytes(){ delete[] _data;}
 };
 
 using Super = std::pair<PyObject*, Type>;