From 1cc369cb191db337d30d588e6f8ebeabb813e0ec Mon Sep 17 00:00:00 2001 From: Alejandro Saucedo Date: Sun, 7 Mar 2021 08:02:30 +0000 Subject: [PATCH] Mark pointer invalid after destroy tensor --- src/Tensor.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Tensor.cpp b/src/Tensor.cpp index 335e48959..aaf6ba388 100644 --- a/src/Tensor.cpp +++ b/src/Tensor.cpp @@ -360,6 +360,10 @@ Tensor::destroy() { KP_LOG_DEBUG("Kompute Tensor started destroy()"); + this->mRawData = nullptr; + this->mSize = 0; + this->mDataTypeMemorySize = 0; + if (!this->mDevice) { KP_LOG_WARN( "Kompute Tensor destructor reached with null Device pointer");