You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by vg...@apache.org on 2007/10/24 02:56:54 UTC

svn commit: r587725 - /cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java

Author: vgritsenko
Date: Tue Oct 23 17:56:54 2007
New Revision: 587725

URL: http://svn.apache.org/viewvc?rev=587725&view=rev
Log:
fix NPE in the dispose

Modified:
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java?rev=587725&r1=587724&r2=587725&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java (original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java Tue Oct 23 17:56:54 2007
@@ -127,7 +127,7 @@
         if (this.processingPipeline != null) {
             this.processingPipeline.setProcessorManager(manager);
         }
-        this.newObjectModel = (ObjectModel)manager.lookup(ObjectModel.ROLE);
+        this.newObjectModel = (ObjectModel) manager.lookup(ObjectModel.ROLE);
     }
 
     /**
@@ -187,13 +187,14 @@
      * Get the pipeline description
      */
     public Processor.InternalPipelineDescription getInternalPipelineDescription(Environment env) {
-        if ( this.internalPipelineDescription == null ) {
+        if (this.internalPipelineDescription == null) {
             this.internalPipelineDescription = new Processor.InternalPipelineDescription(
                     this.processingPipeline, this.pipelineSelector, this.pipelinesManager);
             this.internalPipelineDescription.lastProcessor = this.lastProcessor;
             this.internalPipelineDescription.prefix = env.getURIPrefix();
             this.internalPipelineDescription.uri = env.getURI();
         }
+
         return this.internalPipelineDescription;
     }
 
@@ -329,9 +330,11 @@
      */
     public void dispose() {
         if (this.internalPipelineDescription == null && this.pipelinesManager != null) {
-            if (this.pipelineSelector != null) {
+            if (this.processingPipeline != null) {
                 this.pipelineSelector.release(this.processingPipeline);
                 this.processingPipeline = null;
+            }
+            if (this.pipelineSelector != null) {
                 this.pipelinesManager.release(this.pipelineSelector);
                 this.pipelineSelector = null;
             }
@@ -341,7 +344,13 @@
             this.processingPipelineParameters = null;
             this.processingPipelineObjectModel = null;
         }
-        this.currentManager.release(this.newObjectModel);
+
+        if (this.newObjectModel != null) {
+            this.currentManager.release(this.newObjectModel);
+            this.newObjectModel = null;
+        }
+
+        this.currentManager = null;
     }
 
     /**