You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ju...@apache.org on 2018/02/26 19:33:06 UTC

[sling-org-apache-sling-models-impl] branch master updated: SLING-7517 - fix fake request object memory leak for interface-based models.

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

justin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-models-impl.git


The following commit(s) were added to refs/heads/master by this push:
     new b1ac26c  SLING-7517 - fix fake request object memory leak for interface-based models.
b1ac26c is described below

commit b1ac26cfe2a6b4c6c20bbe30c5d2b3191e8bb5dc
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Mon Feb 26 14:32:59 2018 -0500

    SLING-7517 - fix fake request object memory leak for interface-based models.
---
 src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java b/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java
index 9fcdb12..3f50ad8 100644
--- a/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java
+++ b/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java
@@ -606,8 +606,9 @@ public class ModelAdapterFactory implements AdapterFactory, Runnable, ModelFacto
         if (!registry.callbacks.isEmpty()) {
             registry.seal();
 
-            if (adaptable instanceof ServletRequest) {
-                registerRequestCallbackRegistry((ServletRequest) adaptable, registry);
+            if (adaptable instanceof SlingHttpServletRequest &&
+                    ((SlingHttpServletRequest) adaptable).getAttribute(REQUEST_MARKER_ATTRIBUTE) == REQUEST_MARKER_VALUE) {
+                registerRequestCallbackRegistry((SlingHttpServletRequest) adaptable, registry);
             } else {
                 registerCallbackRegistry(handler, registry);
             }

-- 
To stop receiving notification emails like this one, please contact
justin@apache.org.