You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Luca Morandini <lu...@tin.it> on 2004/10/20 22:55:19 UTC

[FLOW] Sometimes variables initialization fails when they are declared and iniitialized in the same statement

in a (Javascript) flow function of mine, when I write:

var parser;
parser= cocoon.getComponent(DOMParser.ROLE);

everything works fine all the time... but, when I write:

var parser= cocoon.getComponent(DOMParser.ROLE);

sometimes the parser variable is null !

This failed initialization of a variable happens when the same flow 
function is called many times in a short amount of time.
Is it a known bug or am I missing something ?

BTW, the same happens with other type of objects, like:
var os= new java.io.ByteArrayOutputStream();

Regards,

P.S.
I'm using Cocoon 2.1.5 and, yes, I release parser after it has been used.

---------------------------
      Luca Morandini
    lmorandini@ieee.org
http://www.lucamorandini.it
---------------------------