Check AUL initialization
[platform/core/appfw/app-core.git] / tizen-cpp / app-core-cpp / app_core_base.cc
index 5adf51c..bfef0ff 100644 (file)
@@ -45,6 +45,7 @@
 #include "app-core-cpp/app_core_base.hh"
 #include "common/log_private.hh"
 
+extern "C" int aul_is_initialized();
 extern "C" void aul_finalize();
 
 namespace tizen_cpp {
@@ -626,6 +627,11 @@ int AppCoreBase::OnReceive(aul_type type, tizen_base::Bundle b) {
 }
 
 int AppCoreBase::OnCreate() {
+  if (aul_is_initialized()) {
+    _E("AUL is already initialized");
+    return 0;
+  }
+
   int ret = aul_launch_init([](aul_type type, bundle* b, void* data) -> int {
         AppCoreBase* base = reinterpret_cast<AppCoreBase*>(data);
         if (base->impl_->core_delegator_) {