celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpe...@apache.org
Subject celix git commit: CELIX-291: replace setenv/getenv w/ properties_set call
Date Thu, 12 Nov 2015 07:23:30 GMT
Repository: celix
Updated Branches:
  refs/heads/develop 9ed4837b7 -> 3e0b7f8aa


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/3e0b7f8a
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/3e0b7f8a
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/3e0b7f8a

Branch: refs/heads/develop
Commit: 3e0b7f8aa46091a0a91cbb4f3955a4df0546d9d0
Parents: 9ed4837
Author: Bjoern Petri <bpetri@apache.org>
Authored: Thu Nov 12 08:22:20 2015 +0100
Committer: Bjoern Petri <bpetri@apache.org>
Committed: Thu Nov 12 08:22:20 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/3e0b7f8a/framework/private/src/framework.c
----------------------------------------------------------------------
diff --git a/framework/private/src/framework.c b/framework/private/src/framework.c
index 47aabb3..f0268f7 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);
 	}


Mime
View raw message