Hello,
I'm new to C++ and Direct X, and I was wondering what is the proper use of DXGetErrorString and DXGetErrorDescription?
According to http://msdn.microsoft.com/en-us/library/bb173057(VS.85).aspx and http://msdn.microsoft.com/en-us/library/bb173056(VS.85).aspx, these functions return a pointer to a string. However, in all the examples I've seen on the web, they directly use the return value without freeing it afterward.
For example:
char buf[2048];
sprintf(buf, "Error: %s error description: %s\n",DXGetErrorString(hr),DXGetErrorDescription(hr));
Does that mean there is a memory leak because the memory allocated for the error string and the error description is never released ? If not, how is it released ?
Thank you for the help !