You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by st...@apache.org on 2021/09/12 08:09:59 UTC

[openwebbeans] 02/02: OWB-1389 Remove destroyed instance directly

This is an automated email from the ASF dual-hosted git repository.

struberg pushed a commit to branch cdi-2.0
in repository https://gitbox.apache.org/repos/asf/openwebbeans.git

commit c46f732560105c1969ae21eaf645ffa62e356d33
Author: Sebastian Schlatow <se...@cewe.de>
AuthorDate: Tue Sep 7 18:17:11 2021 +0200

    OWB-1389 Remove destroyed instance directly
---
 .../java/org/apache/webbeans/web/tomcat7/TomcatInstanceManager.java    | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/webbeans-tomcat7/src/main/java/org/apache/webbeans/web/tomcat7/TomcatInstanceManager.java b/webbeans-tomcat7/src/main/java/org/apache/webbeans/web/tomcat7/TomcatInstanceManager.java
index f9a8d46..9889341 100644
--- a/webbeans-tomcat7/src/main/java/org/apache/webbeans/web/tomcat7/TomcatInstanceManager.java
+++ b/webbeans-tomcat7/src/main/java/org/apache/webbeans/web/tomcat7/TomcatInstanceManager.java
@@ -47,7 +47,7 @@ public class TomcatInstanceManager implements InstanceManager
     @Override
     public void destroyInstance(Object instance) throws IllegalAccessException, InvocationTargetException
     {
-        Object injectorInstance = this.objects.get(instance);
+        Object injectorInstance = this.objects.remove(instance);
         if (injectorInstance != null)
         {
             try
@@ -64,7 +64,6 @@ public class TomcatInstanceManager implements InstanceManager
             }
         }
         this.processor.destroyInstance(instance);
-        this.objects.remove(instance);
         if (log.isDebugEnabled())
         {
             log.debug("Number of 'objects' map entries after destroying instance: " + this.objects.size());