title: CComBSTR memory management
body: <p>I am using CComBSTR in below scenario,</p>
  
  <pre><code>void MyDlg::OnTimer()
  {
  
        ......
  
        CComBSTR statusString1 = ::SysAllocString(_T("Test"));
  
        ....
  
  }
  </code></pre>
  
  <p>The timer will get executed with in each 5 seconds interval.</p>
  
  <p>In the above case the meory is getting increased for each 5 seconds. As per my understanding the CComBSTR does the memory clean up when it goes out of scope. So the allocated memory has to be freed whenever the timer finishes. But its not.</p>
  
  <p>I need to understand when the memory get freed when the CCOMBSTR is used.</p>