title: reuse of TMemoryStream delphi/c++ builder
body: <p>How to re-use correctly a TMemoryStream in a cycle. For example I have a timer and I'm downloading something from internet directly in a TMemoryStream object.</p>
  
  <p>this object is declared as global variable:</p>
  
  <pre><code>TMemoryStream *ms;
  </code></pre>
  
  <p>then I use it in a timer function:</p>
  
  <pre><code>ms = new TMemoryStream;
  
  .... other operations with ms ....
  </code></pre>
  
  <p>then I use it in other function where i do not need this stream at the end and want to empty it, and i do:</p>
  
  <pre><code>delete ms;
  </code></pre>
  
  <p>and then again is called same timer function, and it does the same cycle allocating and deallocating. It is correctly by this way ?</p>
  
  <p>or I should ms->Clear() or ms->Free() in my last function where stream is no more need ? </p>
  
  <p>I'm interested in how to reuse same global variable to read the stream (allocate) and empty the stream (deallocate).</p>