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

lukaszlenart pushed a commit to branch WW-5537-classloader-leak-fixes
in repository https://gitbox.apache.org/repos/asf/struts.git

commit 81056affd643621af1e52be5ebe744fcc112cd00
Author: Lukasz Lenart <[email protected]>
AuthorDate: Mon Mar 23 09:55:19 2026 +0100

    WW-5537 ScopeInterceptor.clearLocks: add synchronized block
    
    Co-Authored-By: Claude Opus 4.6 <[email protected]>
---
 .../java/org/apache/struts2/interceptor/ScopeInterceptor.java    | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git 
a/core/src/main/java/org/apache/struts2/interceptor/ScopeInterceptor.java 
b/core/src/main/java/org/apache/struts2/interceptor/ScopeInterceptor.java
index b899b7f84..c654316c2 100644
--- a/core/src/main/java/org/apache/struts2/interceptor/ScopeInterceptor.java
+++ b/core/src/main/java/org/apache/struts2/interceptor/ScopeInterceptor.java
@@ -263,6 +263,15 @@ public class ScopeInterceptor extends AbstractInterceptor 
implements PreResultLi
         }
     }
 
+    /**
+     * Clears the locks map to prevent memory leaks during hot redeployment.
+     */
+    public static void clearLocks() {
+        synchronized (locks) {
+            locks.clear();
+        }
+    }
+
     protected void after(ActionInvocation invocation, String result) throws 
Exception {
         Map<String, Object> session = ActionContext.getContext().getSession();
         if ( session != null) {

Reply via email to