Fixed a bug in my last patch...I was forgetting to remove the bundle
from the service registry after unregistering all of its services.


git-svn-id: https://svn.apache.org/repos/asf/incubator/felix/trunk@371676 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/org.apache.felix.framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java b/org.apache.felix.framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java
index e53b932..ccf3d40 100644
--- a/org.apache.felix.framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java
+++ b/org.apache.felix.framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java
@@ -84,7 +84,8 @@
     /**
      * This method retrieves all services registrations for the specified
      * bundle and invokes <tt>ServiceRegistration.unregister()</tt> on each
-     * one.
+     * one. This method is only called be the framework to clean up after
+     * a stopped bundle.
      * @param bundle the bundle whose services should be unregistered.
     **/
     public void unregisterServices(Bundle bundle)
@@ -101,6 +102,9 @@
         {
             regs[i].unregister();
         }
+
+        // Now remove the bundle itself.
+        m_serviceRegsMap.remove(bundle);
     }
 
     public synchronized List getServiceReferences(String className, Filter filter)