I've got a managed c++ library that is crashing when a delete statement is encountered, but it only crashes on a 64-bit build. The code is:
LPWSTR pwmsURL = NULL;
pPresentationCtx->GetStringValue(L"WMS_PRESENT_ORIGINAL_REQUEST_NAME", 17, &pwmsURL, 0);
String^ wmsURL = gcnew String(pwmsURL);
//this delete is the problem line...
delete [] pwmsURL;
If I comment out the delete, everything works fine, but I don't want to create a memory leak. No problems on a 32-bit build. Any idea what's going on with this?