title: C++ delete what wchar_t* points to
body: <p>Title might be confusing. This is a simple thing, but I have searched and tried for an hour now. I have tried everything I have found.</p>
  
  <p>code:</p>
  
  <pre><code>void test() {
  
  
  // Convert
  wchar_t* wcBuff;
  wstring value = convert::stringToWideChar(str);
  wcBuff = (wchar_t*)value.c_str();
  
  // Draw Text
  g-&gt;DrawString(wcBuff,...);
  
  // Clean
  delete wcBuff;
  
  
  }
  </code></pre>
  
  <p>The delete causes the program to crash.</p>