geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r180044 - /geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
Date Sun, 05 Jun 2005 01:22:44 GMT
Author: dain
Date: Sat Jun  4 18:22:40 2005
New Revision: 180044

URL: http://svn.apache.org/viewcvs?rev=180044&view=rev
Log:
Fix memory leak - Call offline on the references when destroying the gbean instance so the
listeners unregister

Modified:
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java?rev=180044&r1=180043&r2=180044&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
(original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
Sat Jun  4 18:22:40 2005
@@ -330,11 +330,15 @@
 
         // if the bean is already stopped or failed, this will do nothing; otherwise it will
shutdown the bean
         int state = getState();
-        if (state == State.STOPPED_INDEX || state == State.FAILED_INDEX) {
-            log.error("GBeanInstance should already be stopped before die() is called: objectName="
+ objectName);
+        if (state != State.STOPPED_INDEX && state != State.FAILED_INDEX) {
+            log.error("GBeanInstance should already be stopped before die() is called: objectName="
+ objectName + " state=" + State.fromInt(state));
         }
 
         gbeanInstanceState.fail();
+
+        for (int i = 0; i < references.length; i++) {
+            references[i].offline();
+        }
 
         // tell everyone we are done
         lifecycleBroadcaster.fireUnloadedEvent();



Mime
View raw message