From fd7c1b04cf9470ff16dec485269478db16a16745 Mon Sep 17 00:00:00 2001 From: yqhan Date: Tue, 21 Jun 2022 17:44:56 +0800 Subject: [PATCH] Resolving memory leaks issue:https://gitee.com/openharmony/js_worker_module/issues/I5DEH6 Describe:In the destructor, the delete object is assigned null. Signed-off-by: yqhan --- helper/object_helper.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/helper/object_helper.h b/helper/object_helper.h index f754863..35e3da1 100644 --- a/helper/object_helper.h +++ b/helper/object_helper.h @@ -43,6 +43,7 @@ public: delete[] value; } else { delete value; + value = nullptr; } } }; @@ -60,6 +61,7 @@ public: delete[] data_; } else { delete data_; + data_ = nullptr; } } -- Gitee