#include <FSec_AccessController.h>
#include "FApp_AppResourceImpl.h"
#include "FApp_AppInfo.h"
+#ifdef _SINGLETON_CLEANUP
+#include "FApp_LongevityManager.h"
+#endif
using namespace Tizen::Base;
using namespace Tizen::Graphics;
if (pSelfAppResource == null)
{
pSelfAppResource = _AppResourceImpl::GetInstanceN(APP_RESOURCE_DEFAULT);
+
+#ifdef _SINGLETON_CLEANUP
+ _LongevityManager::GetInstance().RegisterOwnership(*pSelfAppResource);
+#endif
}
// ClearLastResult(); // as this method does not register any exception.
_AppRegistryImpl::~_AppRegistryImpl(void)
{
- if (__pRegistry != null)
- {
- delete __pRegistry;
- __pRegistry = null;
- }
+ delete __pRegistry;
}
const String& packageId = _AppInfo::GetPackageId();
String regName = _AppInfo::GetAppRootPath() + L"data/";
- SysAssertf(!packageId.IsEmpty(), "Empty packageId.");
- r = regName.Append(static_cast <const String&>(packageId));
+ SysAssertf(!packageId.IsEmpty(), "Empty package.");
+ r = regName.Append(packageId);
SysTryReturn(NID_APP, !IsFailed(r), r, r, "[%s] String appending has failed.", GetErrorMessage(r));
__pRegistry = new (std::nothrow) Registry();
r = __pContainer->ContainsKey(value, hasAppResource);
SysTryReturn(NID_APP, !IsFailed(r), null, r, "[%s] Checking to contain is failed.", GetErrorMessage(r));
- if(hasAppResource == true)
+ if (hasAppResource)
{
return static_cast<AppResource*> (__pContainer->GetValue(value));
}