From abb03e5f8a4dc38146143e999d1040832fb894e7 Mon Sep 17 00:00:00 2001 From: Changgyu Choi Date: Thu, 1 Dec 2022 11:39:27 +0900 Subject: [PATCH] Prevent context_ invalid access When AppCoreBase was destructed, context_ is invalid. So in this case, it is necessary to set context_ to nullptr to prevent invalid access. Change-Id: I0641e4394f250022863b370bf0b472e483d6367d Signed-off-by: Changgyu Choi --- tizen-cpp/app-core-cpp/app_core_base.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tizen-cpp/app-core-cpp/app_core_base.cc b/tizen-cpp/app-core-cpp/app_core_base.cc index e4e6e86..63e5d31 100644 --- a/tizen-cpp/app-core-cpp/app_core_base.cc +++ b/tizen-cpp/app-core-cpp/app_core_base.cc @@ -251,7 +251,10 @@ AppCoreBase::AppCoreBase() context_ = this; } -AppCoreBase::~AppCoreBase() = default; +AppCoreBase::~AppCoreBase() { + _I(""); + context_ = nullptr; +} AppCoreBase* AppCoreBase::GetContext() { if (context_ == nullptr) { -- 2.7.4