If I have the following piece of code :
void foo (String^ v)
{
WCHAR someString[256];
_tcscpy_s(someString, (LPCTSTR)Marshal::StringtoHGLobalUni(v).ToPointer());
}
Would I still need to use FreeHGlobal()
in this case? And if so, why? Would the copy function not take care of this global allocation?