felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r468402 - /incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/EventDispatcher.java
Date Fri, 27 Oct 2006 14:58:48 GMT
Author: rickhall
Date: Fri Oct 27 07:58:48 2006
New Revision: 468402

URL: http://svn.apache.org/viewvc?view=rev&rev=468402
Log:
Fixed a bug when removing listeners; it was using the wrong index into the
listener array, so listeners were not being removed, which was inhibiting
garbage collection.

Modified:
    incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/EventDispatcher.java

Modified: incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/EventDispatcher.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/EventDispatcher.java?view=diff&rev=468402&r1=468401&r2=468402
==============================================================================
--- incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/EventDispatcher.java
(original)
+++ incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/EventDispatcher.java
Fri Oct 27 07:58:48 2006
@@ -334,11 +334,11 @@
             {
                 // Check if the bundle associated with the current listener
                 // is the same as the specified bundle, if so remove the listener.
-                Bundle registeredBundle = (Bundle) listeners[LISTENER_BUNDLE_OFFSET];
+                Bundle registeredBundle = (Bundle) listeners[i + LISTENER_BUNDLE_OFFSET];
                 if (bundle.equals(registeredBundle))
                 {
-                    Class clazz = (Class) listeners[LISTENER_CLASS_OFFSET];
-                    EventListener l = (EventListener) listeners[LISTENER_OBJECT_OFFSET];
+                    Class clazz = (Class) listeners[i + LISTENER_CLASS_OFFSET];
+                    EventListener l = (EventListener) listeners[i + LISTENER_OBJECT_OFFSET];
                     removeListener(bundle, clazz, l);
                 }
             }
@@ -351,11 +351,11 @@
             {
                 // Check if the bundle associated with the current listener
                 // is the same as the specified bundle, if so remove the listener.
-                Bundle registeredBundle = (Bundle) listeners[LISTENER_BUNDLE_OFFSET];
+                Bundle registeredBundle = (Bundle) listeners[i + LISTENER_BUNDLE_OFFSET];
                 if (bundle.equals(registeredBundle))
                 {
-                    Class clazz = (Class) listeners[LISTENER_CLASS_OFFSET];
-                    EventListener l = (EventListener) listeners[LISTENER_OBJECT_OFFSET];
+                    Class clazz = (Class) listeners[i + LISTENER_CLASS_OFFSET];
+                    EventListener l = (EventListener) listeners[i + LISTENER_OBJECT_OFFSET];
                     removeListener(bundle, clazz, l);
                 }
             }
@@ -369,11 +369,11 @@
             {
                 // Check if the bundle associated with the current listener
                 // is the same as the specified bundle, if so remove the listener.
-                Bundle registeredBundle = (Bundle) listeners[LISTENER_BUNDLE_OFFSET];
+                Bundle registeredBundle = (Bundle) listeners[i + LISTENER_BUNDLE_OFFSET];
                 if (bundle.equals(registeredBundle))
                 {
-                    Class clazz = (Class) listeners[LISTENER_CLASS_OFFSET];
-                    EventListener l = (EventListener) listeners[LISTENER_OBJECT_OFFSET];
+                    Class clazz = (Class) listeners[i + LISTENER_CLASS_OFFSET];
+                    EventListener l = (EventListener) listeners[i + LISTENER_OBJECT_OFFSET];
                     removeListener(bundle, clazz, l);
                 }
             }
@@ -386,11 +386,11 @@
             {
                 // Check if the bundle associated with the current listener
                 // is the same as the specified bundle, if so remove the listener.
-                Bundle registeredBundle = (Bundle) listeners[LISTENER_BUNDLE_OFFSET];
+                Bundle registeredBundle = (Bundle) listeners[i + LISTENER_BUNDLE_OFFSET];
                 if (bundle.equals(registeredBundle))
                 {
-                    Class clazz = (Class) listeners[LISTENER_CLASS_OFFSET];
-                    EventListener l = (EventListener) listeners[LISTENER_OBJECT_OFFSET];
+                    Class clazz = (Class) listeners[i + LISTENER_CLASS_OFFSET];
+                    EventListener l = (EventListener) listeners[i + LISTENER_OBJECT_OFFSET];
                     removeListener(bundle, clazz, l);
                 }
             }



Mime
View raw message