celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject [1/2] celix git commit: CELIX-446: Removes unregister from bundle_context, this will be done during bundle_stop
Date Thu, 19 Apr 2018 08:54:53 GMT
Repository: celix
Updated Branches:
  refs/heads/develop 83cf4c964 -> 333707934


CELIX-446: Removes unregister from bundle_context, this will be done during bundle_stop


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/677c23af
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/677c23af
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/677c23af

Branch: refs/heads/develop
Commit: 677c23afb278eb0ea57a3e4310b7dc87a68ec095
Parents: 78460c7
Author: Pepijn Noltes <pepijnnoltes@gmail.com>
Authored: Thu Apr 19 10:54:02 2018 +0200
Committer: Pepijn Noltes <pepijnnoltes@gmail.com>
Committed: Thu Apr 19 10:54:02 2018 +0200

----------------------------------------------------------------------
 .travis.yml                                   | 12 +++++++-----
 cmake/cmake_celix/create_target_filesystem.sh |  4 ++--
 framework/src/bundle_context.c                | 17 +++--------------
 framework/src/service_registry.c              |  2 +-
 4 files changed, 13 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/677c23af/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 847c52d..f8de607 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -36,11 +36,13 @@ matrix:
          dist: trusty
          compiler: gcc
          env: SANITIZE=1
-         #       - os: linux
-         #dist: trusty
-         #compiler: clang
-         #env: ANDROID=1
-         #services: docker
+
+#DISABLED ANDROID BUILD
+#       - os: linux
+#dist: trusty
+#compiler: clang
+#env: ANDROID=1
+#services: docker
 
 before_install:
   - if [ "$TRAVIS_OS_NAME" = "linux" ] &&  [ -z "$ANDROID" ]; then sudo add-apt-repository
ppa:ubuntu-toolchain-r/test -y && sudo apt-get -qq update && sudo apt-get
install -y uuid-dev libxml2-dev lcov libffi-dev gcc-4.8 g++-4.8; fi

http://git-wip-us.apache.org/repos/asf/celix/blob/677c23af/cmake/cmake_celix/create_target_filesystem.sh
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/create_target_filesystem.sh b/cmake/cmake_celix/create_target_filesystem.sh
index 73f341c..96964f3 100644
--- a/cmake/cmake_celix/create_target_filesystem.sh
+++ b/cmake/cmake_celix/create_target_filesystem.sh
@@ -66,7 +66,7 @@ celix_add_file() {
 		fi
 
 		mkdir -p ${DIR} 2> /dev/null
-		cp -vu ${FILE} ${DIR}/
+		cp -vu ${FILE} ${DIR}/ 
 	else
 		echo "Skipping file ${FILE}"
 	fi
@@ -138,7 +138,7 @@ celix_add_required_libs() {
 		echo "ERROR: Assuming 64 bit architecture for docker creating. Created filesystem will
not be valid"
 	fi
 	#LIBS=$(ls -1 /lib64/ld-linux* /lib64/libnss_dns* /lib64/libnss_files*)
-	LIBS=$(ls -1 /lib64/ld-linux* /lib64/libnss_dns* /lib64/libnss_files* /lib/x86_64-linux-gnu/libnss_dns*
/lib/x86_64-linux-gnu/libnss_files*)
+	LIBS=$(ls -1 /lib64/ld-linux* /lib64/libnss_dns* /lib64/libnss_files* /lib/x86_64-linux-gnu/libnss_dns*
/lib/x86_64-linux-gnu/libnss_files* 2> /dev/null)
 	for LIB in ${LIBS}
 	do
 		celix_add_file ${LIB} 

http://git-wip-us.apache.org/repos/asf/celix/blob/677c23af/framework/src/bundle_context.c
----------------------------------------------------------------------
diff --git a/framework/src/bundle_context.c b/framework/src/bundle_context.c
index 4cb0253..fc0e5b3 100644
--- a/framework/src/bundle_context.c
+++ b/framework/src/bundle_context.c
@@ -59,22 +59,11 @@ celix_status_t bundleContext_destroy(bundle_context_pt context) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	if (context != NULL) {
-	    bool last = false;
-	    do {
-            service_registration_t *reg = NULL;
             celixThreadMutex_lock(&context->mutex);
-            if (arrayList_size(context->svcRegistrations) > 0) {
-                reg = arrayList_remove(context->svcRegistrations, 0);
-            } else {
-                last = true;
-            }
-            celixThreadMutex_unlock(&context->mutex);
-            if (reg != NULL) {
-                serviceRegistration_unregister(reg);
-            }
-	    } while (!last);
 
-	    celixThreadMutex_destroy(&context->mutex);
+	    //NOTE still present service registartion will be cleared during bundle stop in the
+	    //service registry (serviceRegistry_clearServiceRegistrations).
+	    celixThreadMutex_destroy(&context->mutex); 
 	    arrayList_destroy(context->svcRegistrations);
 	    free(context);
 	} else {

http://git-wip-us.apache.org/repos/asf/celix/blob/677c23af/framework/src/service_registry.c
----------------------------------------------------------------------
diff --git a/framework/src/service_registry.c b/framework/src/service_registry.c
index d27cc32..0d012d8 100644
--- a/framework/src/service_registry.c
+++ b/framework/src/service_registry.c
@@ -273,7 +273,7 @@ celix_status_t serviceRegistry_clearServiceRegistrations(service_registry_pt
reg
 static void serviceRegistry_logWarningServiceRegistration(service_registry_pt registry __attribute__((unused)),
service_registration_pt reg) {
     const char *servName = NULL;
     serviceRegistration_getServiceName(reg, &servName);
-    fw_log(logger, OSGI_FRAMEWORK_LOG_WARNING, "Dangling service registration for service
%s. Look for missing serviceRegistration_unregister calls.", servName);
+    fw_log(logger, OSGI_FRAMEWORK_LOG_WARNING, "Dangling service registration for service
%s. Look for missing bundleContext_unregisterService/serviceRegistration_unregister calls.",
servName);
 }
 
 celix_status_t serviceRegistry_getServiceReference(service_registry_pt registry, bundle_pt
owner,


Mime
View raw message