Add nullptr check of EcoreHandler 13/274613/1
authorHwankyu Jhun <h.jhun@samsung.com>
Tue, 3 May 2022 10:49:03 +0000 (19:49 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 3 May 2022 10:49:03 +0000 (19:49 +0900)
Before calling methods of EcoreHandler, the AppCoreMultiWindowBase
should check whether the handler is nullptr or not.

Change-Id: I3a52492d3ecefef46ae5ecc7bb4ffd6bc06fb3c0
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
tizen-cpp/app-core-multi-window-cpp/app_core_multi_window_base.cc

index 6f3e89c..86261da 100644 (file)
@@ -219,9 +219,12 @@ void AppCoreMultiWindowBase::Dispose() {
   }
   impl_->contexts_.clear();
   impl_->factory_map_.clear();
-  impl_->handler_->UnsetEvents();
+
   AppCoreBase::Dispose();
-  impl_->handler_->Fini();
+  if (impl_->handler_.get() != nullptr) {
+    impl_->handler_->UnsetEvents();
+    impl_->handler_->Fini();
+  }
 }
 
 int AppCoreMultiWindowBase::OnCreate() {