You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by ej...@apache.org on 2016/08/04 12:26:15 UTC
celix git commit: CELIX-372: added information on warning origin
Repository: celix
Updated Branches:
refs/heads/develop 7841ff75d -> 5f3a82539
CELIX-372: added information on warning origin
Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/5f3a8253
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/5f3a8253
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/5f3a8253
Branch: refs/heads/develop
Commit: 5f3a825392b84a3d53ac0de7ce3d5eb3c30d6b6e
Parents: 7841ff7
Author: Erik Jansman <ej...@apache.org>
Authored: Thu Aug 4 14:25:47 2016 +0200
Committer: Erik Jansman <ej...@apache.org>
Committed: Thu Aug 4 14:25:47 2016 +0200
----------------------------------------------------------------------
framework/private/src/service_registry.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/celix/blob/5f3a8253/framework/private/src/service_registry.c
----------------------------------------------------------------------
diff --git a/framework/private/src/service_registry.c b/framework/private/src/service_registry.c
index c343c7c..a5dd20c 100644
--- a/framework/private/src/service_registry.c
+++ b/framework/private/src/service_registry.c
@@ -540,6 +540,7 @@ static void serviceRegistry_logWarningServiceReferenceUsageCount(service_registr
celix_status_t serviceRegistry_clearReferencesFor(service_registry_pt registry, bundle_pt bundle) {
celix_status_t status = CELIX_SUCCESS;
+ int echoName =0;
celixThreadRwlock_writeLock(®istry->lock);
hash_map_pt refsMap = hashMap_remove(registry->serviceReferences, bundle);
@@ -552,6 +553,10 @@ celix_status_t serviceRegistry_clearReferencesFor(service_registry_pt registry,
serviceReference_getUsageCount(ref, &usageCount);
serviceReference_getReferenceCount(ref, &refCount);
+ if(refCount>0)
+ {
+ echoName++;
+ }
serviceRegistry_logWarningServiceReferenceUsageCount(registry, usageCount, refCount);
@@ -570,6 +575,15 @@ celix_status_t serviceRegistry_clearReferencesFor(service_registry_pt registry,
hashMap_destroy(refsMap, false, false);
}
+ if(echoName >0)
+ {
+ module_pt module_ptr = NULL;
+ bundle_getCurrentModule(bundle, &module_ptr);
+ const char *name_str = NULL;
+ module_getSymbolicName(module_ptr, &name_str);
+ fw_log(logger, OSGI_FRAMEWORK_LOG_WARNING,"Previous Dangling service reference warnings caused by bundle: %s",name_str);
+ }
+
celixThreadRwlock_unlock(®istry->lock);
return status;