commit | d86501e3e23ce69e6b3ab487b00a0bca43b022dc | [log] [tgz] |
---|---|---|
author | A. J. David Bosschaert <davidb@apache.org> | Wed Jun 10 10:30:09 2015 +0000 |
committer | A. J. David Bosschaert <davidb@apache.org> | Wed Jun 10 10:30:09 2015 +0000 |
tree | a596ca286636d3d33aeaa3d3ded5934c2035db03 | |
parent | e3412606eb0922e44b9b586668a5f597463c5ed0 [diff] |
Further fix for potential race condition in Service Registry. git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1684634 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java b/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java index a66f7e3..16ab677 100644 --- a/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java +++ b/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java
@@ -419,9 +419,11 @@ { if (count == 0) { + Object svc = usage.m_svcHolderRef.getAndSet(null).m_service; + // Remove reference from usages array. ((ServiceRegistrationImpl.ServiceReferenceImpl) ref) - .getRegistration().ungetService(bundle, usage.getService()); + .getRegistration().ungetService(bundle, svc); } } finally