+void
+_AppResourceImpl::InitSingleton(void)
+{
+ std::unique_ptr< HashMap > pContainer(new (std::nothrow) HashMap(SingleObjectDeleter));
+ SysTryReturnVoidResult(NID_APP, pContainer != null, E_OUT_OF_MEMORY, "[%s] Creating the container is failed.");
+
+ result r = pContainer->Construct();
+ SysTryReturnVoidResult(NID_APP, !IsFailed(r), E_SYSTEM, "[E_SYSTEM] Constructing the container is failed.");
+
+ __pContainer = pContainer.release();
+
+ std::unique_ptr< Mutex > pLock(new (std::nothrow) Mutex());
+ SysTryReturnVoidResult(NID_APP, pLock != null, E_OUT_OF_MEMORY, "[%s] Creating the mutex is failed.");
+
+ r = pLock->Create();
+ SysTryReturnVoidResult(NID_APP, !IsFailed(r), E_SYSTEM, "[E_SYSTEM] Constructing the mutex is failed.");
+
+ __pLock = pLock.release();
+
+ std::atexit(DestroySingleton);
+}
+
+void
+_AppResourceImpl::DestroySingleton(void)
+{
+ delete __pContainer;
+ delete __pLock;
+}
+