ACHAR *chArxPath = NULL;
acutUpdString(_T("command"), chArxPath);
acutDelString(chArxPath);
Can I use "delete [] chArxPath"?
Is something diffrent?
Because I use new ACHAR[] sometime.
This is the inline implementation of acutDelString() in acutmem.h:
inline void acutDelString(wchar_t *& pString) { ::acutDelBuffer((void * &)pString); }
As you can see it calls acutDelBuffer(void *& pString). This can't be exactly the same as delete [] pString.
So I would not recommend to mix new ACHAR [] and acutDelString().
In my opinion, ACHAR *chArxPath = NULL define a string literal. The string literal is initialised into read-only memory segment by the compiler. There is no initialisation or removal done at run-time. So no need to delete.
ACHAR *chArxPath = NULL;
You don't need to free chArxPath at this point. Obviously.
acutUpdString(_T("command"), chArxPath);
Makes a deep copy of "command" and sets chArxPath to point to this new allocated string. It will not just copy the pointer.
Now you have to free chArxPath with acutDelString(chArxPath) if you don't need it anymore to avoid memory leaks. See docs for acutUpdString().
I suppose this:
ACHAR *chArxPath = L"old"; acutUpdString(L"new", chArxPath);
would cause an exception because acutUpdString() will release the memory for chArxPath if it is !=NULL.
But chArxPath points to the fixed memory segment L"old", that can't be freed.