You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pn...@apache.org on 2015/11/17 12:57:30 UTC
[13/38] celix git commit: CELIX-291: replace setenv/getenv w/
properties_set call
CELIX-291: replace setenv/getenv w/ properties_set call
Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/e651c8a6
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/e651c8a6
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/e651c8a6
Branch: refs/heads/develop
Commit: e651c8a63f1856db0efd16c10b3d6f77c00b921c
Parents: 37720bd
Author: Bjoern Petri <bp...@apache.org>
Authored: Thu Nov 12 08:22:20 2015 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Thu Nov 12 17:40:27 2015 +0100
----------------------------------------------------------------------
framework/private/src/framework.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/celix/blob/e651c8a6/framework/private/src/framework.c
----------------------------------------------------------------------
diff --git a/framework/private/src/framework.c b/framework/private/src/framework.c
index 7e66dbe..d603207 100644
--- a/framework/private/src/framework.c
+++ b/framework/private/src/framework.c
@@ -329,8 +329,6 @@ celix_status_t framework_destroy(framework_pt framework) {
bundleCache_destroy(&framework->cache);
- unsetenv(OSGI_FRAMEWORK_FRAMEWORK_UUID);
-
celixThreadCondition_destroy(&framework->dispatcher);
celixThreadMutex_destroy(&framework->bundleListenerLock);
celixThreadMutex_destroy(&framework->dispatcherLock);
@@ -359,7 +357,6 @@ celix_status_t fw_init(framework_pt framework) {
linked_list_pt wires = NULL;
array_list_pt archives = NULL;
bundle_archive_pt archive = NULL;
- char uuid[37];
celix_status_t status = CELIX_SUCCESS;
status = CELIX_DO_IF(status, framework_acquireBundleLock(framework, framework->bundle, OSGI_FRAMEWORK_BUNDLE_INSTALLED|OSGI_FRAMEWORK_BUNDLE_RESOLVED|OSGI_FRAMEWORK_BUNDLE_STARTING|OSGI_FRAMEWORK_BUNDLE_ACTIVE));
@@ -387,11 +384,13 @@ celix_status_t fw_init(framework_pt framework) {
if (status == CELIX_SUCCESS) {
/*create and store framework uuid*/
+ char uuid[37];
+
uuid_t uid;
uuid_generate(uid);
uuid_unparse(uid, uuid);
- // #TODO setenv has a memory leak
- setenv(OSGI_FRAMEWORK_FRAMEWORK_UUID, uuid, true);
+
+ properties_set(framework->configurationMap, (char*) OSGI_FRAMEWORK_FRAMEWORK_UUID, uuid);
framework->installedBundleMap = hashMap_create(utils_stringHash, NULL, utils_stringEquals, NULL);
}