You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ri...@apache.org on 2009/02/20 17:36:58 UTC

svn commit: r746289 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java

Author: rickhall
Date: Fri Feb 20 16:36:57 2009
New Revision: 746289

URL: http://svn.apache.org/viewvc?rev=746289&view=rev
Log:
When unregistering all services for a bundle, verify each registration is
valid before unregistering, since it is possible that an event from a
subsequent unregister caused the unregistering of another service. (FELIX-952)

Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java?rev=746289&r1=746288&r2=746289&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java Fri Feb 20 16:36:57 2009
@@ -141,7 +141,10 @@
         // Unregister each service.
         for (int i = 0; (regs != null) && (i < regs.length); i++)
         {
-            regs[i].unregister();
+            if (((ServiceRegistrationImpl) regs[i]).isValid())
+            {
+                regs[i].unregister();
+            }
         }
 
         // Now remove the bundle itself.