When distributing a new BSTR using SysAllocString via wchar_t * on the heap, do I have to free the original wchar_t * on the heap?
So is this the right way?
wchar_t *hs = new wchar_t[20];
Should I call delete here to free memory? Or is this memory just adopted by the BSTR?
c ++ string memory-management windows bstr
noctonura
source share