#include "log.h"
static const char* __TIZEN_API_PATH_KEY = "db/dotnet/tizen_api_path";
-static const char* PLATFORM_TPA_CACHE = "/usr/share/dotnet.tizen/lib/platform_tpa_cache";
#define __XSTR(x) #x
#define __STR(x) __XSTR(x)
static DllPath* __dllPath = nullptr;
static std::string __tpa;
+bool initializedPathManager = false;
// on success, return 0. otherwise return -1.
int initializePathManager(const std::string& runtimeDir, const std::string& tizenFXDir, const std::string& extraDir)
{
+ if (initializedPathManager) {
+ _INFO("Path manager already initialized");
+ return 0;
+ }
+
__dllPath = new DllPath();
if (!__dllPath) {
_ERR("fail to allocate memory for dll path structure\n");
if (tmp) {
__dllPath->tizenfx_dir = std::string(tmp);
_DBG("Device API Directory is set by vconf : %s", tmp);
+ free(tmp);
} else {
__dllPath->tizenfx_dir = absolutePath(__DEVICE_API_DIR);
}
_INFO("Path manager initialize success");
+ initializedPathManager = true;
return 0;
}
delete __dllPath;
__dllPath = NULL;
}
+
+ initializedPathManager = false;
}
std::string getRuntimeDir()
std::string platform_tpa;
if (isFileExist(PLATFORM_TPA_CACHE)) {
- _INFO("platform tpa cache found.\n");
+ _INFO("platform tpa cache found.");
std::ifstream cacheFile;
cacheFile.open(PLATFORM_TPA_CACHE);
std::getline(cacheFile, platform_tpa);