Unverified Commit 31c2f979 by Lianmin Zheng Committed by GitHub

[RUNTIME] Fix memory leakage of TVMByteArray (#4856)

parent 902e21bd
...@@ -875,7 +875,7 @@ class TVMRetValue : public TVMPODValue_ { ...@@ -875,7 +875,7 @@ class TVMRetValue : public TVMPODValue_ {
void Clear() { void Clear() {
if (type_code_ == kTVMNullptr) return; if (type_code_ == kTVMNullptr) return;
switch (type_code_) { switch (type_code_) {
case kTVMStr: delete ptr<std::string>(); break; case kTVMStr: case kTVMBytes: delete ptr<std::string>(); break;
case kTVMPackedFuncHandle: delete ptr<PackedFunc>(); break; case kTVMPackedFuncHandle: delete ptr<PackedFunc>(); break;
case kTVMNDArrayHandle: { case kTVMNDArrayHandle: {
NDArray::FFIDecRef(static_cast<TVMArrayHandle>(value_.v_handle)); NDArray::FFIDecRef(static_cast<TVMArrayHandle>(value_.v_handle));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment