summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChanggyu Choi <changyu.choi@samsung.com>2022-12-01 11:39:27 +0900
committerChanggyu Choi <changyu.choi@samsung.com>2022-12-01 11:39:27 +0900
commitabb03e5f8a4dc38146143e999d1040832fb894e7 (patch)
treeabab8196c55c8d8799d79e45d14666160d3e98c1
parentad8a30d611543b377d44e26c51c4a63f7853701b (diff)
downloadapp-core-abb03e5f8a4dc38146143e999d1040832fb894e7.tar.gz
app-core-abb03e5f8a4dc38146143e999d1040832fb894e7.tar.bz2
app-core-abb03e5f8a4dc38146143e999d1040832fb894e7.zip
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 <changyu.choi@samsung.com>
-rw-r--r--tizen-cpp/app-core-cpp/app_core_base.cc5
1 files changed, 4 insertions, 1 deletions
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) {