Only remove the ListenerInfo, if the removed Listener was the last one referenced by that ListenerInfo.
@@ -172,11 +172,13 @@ public class BundleComponentActivator implements ComponentActivator
ListenerInfo listenerInfo = listenerMap.get( serviceFilterString );
if ( listenerInfo != null )
{
+ if (listenerInfo.remove(listener)) {
listenerMap.remove(serviceFilterString);
m_context.removeServiceListener(listenerInfo);
}
}
}
+ }
/**
* Called upon starting of the bundle. This method invokes initialize() which
