From 54819869d4289ecbecc4874cc297dd2ffbecb058 Mon Sep 17 00:00:00 2001 From: Young Ik Cho Date: Tue, 3 Sep 2013 13:52:06 +0900 Subject: [PATCH] preload AppControl registry Change-Id: I9ebd61dda90d71b5b9fdcfc0b9a55d5099c210cd Signed-off-by: Young Ik Cho --- src/app/CMakeLists.txt | 1 + src/app/FAppInit.cpp | 46 +++++++++++++++++++++++++++++++++++ src/app/FApp_AppControlRegistry.cpp | 7 ------ src/app/FApp_AppControlRegistry.h | 8 ++++-- src/app/inc/FAppPkg_PackageInfoImpl.h | 4 --- src/osp-init/Osp.cpp | 10 +++++++- 6 files changed, 62 insertions(+), 14 deletions(-) create mode 100644 src/app/FAppInit.cpp diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index 86c07e8..f24fd71 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -44,6 +44,7 @@ SET (${this_target}_SOURCE_FILES FApp_AppEntry.cpp FApp_AppInfo.cpp FApp_AppArg.cpp + FAppInit.cpp FAppNotificationManager.cpp FApp_NotificationManagerImpl.cpp FApp_AppManagerIpcMessage.cpp diff --git a/src/app/FAppInit.cpp b/src/app/FAppInit.cpp new file mode 100644 index 0000000..615819f --- /dev/null +++ b/src/app/FAppInit.cpp @@ -0,0 +1,46 @@ +// +// Copyright (c) 2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FApp_AppInit.cpp + */ + +#include "FApp_AppControlRegistry.h" + + +using namespace Tizen::App; + + +static _AppControlRegistry* pRegs = null; + +extern "C" +{ + +void +FApp_Initialize(void) +{ + pRegs = _AppControlRegistry::GetInstance(); +} + +void +FApp_Finalize(void) +{ + delete pRegs; + pRegs = null; +} + +} + diff --git a/src/app/FApp_AppControlRegistry.cpp b/src/app/FApp_AppControlRegistry.cpp index 4e09423..866f405 100644 --- a/src/app/FApp_AppControlRegistry.cpp +++ b/src/app/FApp_AppControlRegistry.cpp @@ -41,9 +41,6 @@ #include "FApp_AppControlRegistry.h" #include "FApp_AppMessageImpl.h" #include "FApp_TemplateUtil.h" -#ifdef _SINGLETON_CLEANUP -#include "FApp_LongevityManager.h" -#endif using namespace Tizen::App::Package; using namespace Tizen::Base; @@ -106,10 +103,6 @@ _AppControlRegistry::GetInstance(void) __pSelf->LoadLegacyList(); __pSelf->LoadAliasList(); - -#ifdef _SINGLETON_CLEANUP - _LongevityManager::GetInstance().RegisterOwnership(*__pSelf); -#endif } return __pSelf; diff --git a/src/app/FApp_AppControlRegistry.h b/src/app/FApp_AppControlRegistry.h index c9f8201..30c413e 100644 --- a/src/app/FApp_AppControlRegistry.h +++ b/src/app/FApp_AppControlRegistry.h @@ -30,6 +30,11 @@ #include #include +namespace Tizen { namespace Base { namespace Collection +{ + class ArrayList; +}}} + namespace Tizen { namespace App { @@ -52,7 +57,6 @@ struct BundleDeleter * @since 2.1 */ class _AppControlRegistry - : public Tizen::Base::Object { public: class _AppControlAliasEntry @@ -81,7 +85,7 @@ public: _AppControlRegistry(void); - virtual ~_AppControlRegistry(void); + ~_AppControlRegistry(void); static _AppControlRegistry* GetInstance(void); diff --git a/src/app/inc/FAppPkg_PackageInfoImpl.h b/src/app/inc/FAppPkg_PackageInfoImpl.h index 3a3062d..fed0e86 100644 --- a/src/app/inc/FAppPkg_PackageInfoImpl.h +++ b/src/app/inc/FAppPkg_PackageInfoImpl.h @@ -31,10 +31,6 @@ #include -namespace Tizen { namespace App -{ -class _AppManagerProxy; -}} namespace Tizen { namespace App { namespace Package { diff --git a/src/osp-init/Osp.cpp b/src/osp-init/Osp.cpp index d430513..b54414a 100644 --- a/src/osp-init/Osp.cpp +++ b/src/osp-init/Osp.cpp @@ -27,19 +27,27 @@ extern "C" extern void FBase_Initialize(void); extern void FBase_Finalize(void); +extern void FApp_Initialize(void); +extern void FApp_Finalize(void); + __attribute__((constructor)) void _OSP_EXPORT_ Osp_Initialize(void) { // FBase_Initialize() is moved to FApp_AppInfo.cpp due to the preloading issue. - OpenSSL_add_all_algorithms(); + + FApp_Initialize(); + + OpenSSL_add_all_algorithms(); } __attribute__((destructor)) void _OSP_EXPORT_ Osp_Finalize(void) { + FApp_Finalize(); + //FBase_Finalize(); EVP_cleanup(); } -- 2.7.4