Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 75080 invoked from network); 9 Jan 2004 01:24:44 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 9 Jan 2004 01:24:44 -0000 Received: (qmail 81984 invoked by uid 500); 9 Jan 2004 01:24:23 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 81969 invoked by uid 500); 9 Jan 2004 01:24:23 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 81805 invoked from network); 9 Jan 2004 01:24:22 -0000 Received: from unknown (HELO mout.perfora.net) (217.160.230.41) by daedalus.apache.org with SMTP; 9 Jan 2004 01:24:22 -0000 Received: from [217.160.230.52] (helo=smtp.perfora.net) by mout.perfora.net with esmtp (Exim 3.35 #1) id 1AelO2-0006pP-00 for dev@cocoon.apache.org; Thu, 08 Jan 2004 20:24:30 -0500 Received: from [208.185.179.12] (helo=reverycodes.com) by smtp.perfora.net with asmtp (TLSv1:RC4-MD5:128) (Exim 3.35 #1) id 1AelO1-00022K-00 for dev@cocoon.apache.org; Thu, 08 Jan 2004 20:24:30 -0500 Message-ID: <3FFDDB22.9090000@reverycodes.com> Date: Thu, 08 Jan 2004 17:35:14 -0500 From: Vadim Gritsenko User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: Releasing components in flowscripts References: <20040108193615.47184.qmail@web41904.mail.yahoo.com> In-Reply-To: <20040108193615.47184.qmail@web41904.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Tim Larson wrote: >I was talking with on #cocoon trying to figure out >if/when/how components needed to be released in flowscripts, >and we realized the docs need to be more enlightening. > >Here is what we wrote so far: >All components obtained via getComponent must be explicitly >released via releaseComponent() in your flowscript before >calling sendPage() or sendPageAndWait(), otherwise a memory >leak will occur. If these components have given you any >other components (such as a Source), they must be released >before the parent component is released. > >We think this is overstating the releasing requirements for >sendPage(). Anybody want to help us improve this? > >I would also like to put a simple example in the docs, >something like: > function someFunction() { > var resolver = cocoon.getComponent(..); > var source = resolver.resolveURI(..); > // Insert code here that uses source. > resolver.release(source); > > } finally { > cocoon.releaseComponent(resolver); > cocoon.sendPage(..); > } > >Where in the docs/javadocs/wiki should all of this go? > > "Using Components in a Flowscript", does this page exist? Vadim