If  you use the str() member function of ostrstream, you must either call
ostrstream::freeze() with a value of false, or delete the pointer yourself:

   void
   foo(bool fDoDelete)
   {
       ostrstream    theOutputStream;

       ...

       const char* const   theData = theOutputStream.str();

       ...

       if (fDoDelete == true)
       {
           delete [] theData;
       }
       else
       {
           theOutputStream.freeze(false);
       }
   }

This is how ostrstream works, and is not a memory leak in Xalan.

If, however, you are not doing this, then it may be a leak in Xalan.  Your
message doesn't have nearly enough detail to figure out what might be
happening, so you might want to elaborate a bit.

Dave



                                                                                       
          
                    "Ofer Kalisky"                                                     
          
                    <kalisky@messag        To:     <[EMAIL PROTECTED]>          
          
                    evine.com>             cc:     (bcc: David N Bertoni/CAM/Lotus)    
          
                                           Subject:     Memory leak in xalan           
          
                    11/06/2001                                                         
          
                    04:26 AM                                                           
          
                    Please respond                                                     
          
                    to xalan-dev                                                       
          
                                                                                       
          
                                                                                       
          



When the XalanTransformer::transform method is called, I see a memory leak
of the stream. Is it just me (should I delete the stream after use) or is
there a problem with the method. BTW, I didn't find anything about it in
the
known bugs...

Thanks.





Reply via email to