The call to GetName creates a new FString, and we immediately use the * operator to get its TCHAR* buffer without storing the string. This means the string immediately falls out of scope, so RenderTargetTextureDesc ends up with a dangling pointer for its debug name. When running with -stompmalloc, this causes a crash on startup.
Moving the string to a const value outside the call site guarantees that the debug name buffer remains in scope until RenderTargetTextureDesc is destroyed at the end of the function call.
The call to
GetName
creates a newFString
, and we immediately use the*
operator to get itsTCHAR*
buffer without storing the string. This means the string immediately falls out of scope, soRenderTargetTextureDesc
ends up with a dangling pointer for its debug name. When running with-stompmalloc
, this causes a crash on startup.Moving the string to a const value outside the call site guarantees that the debug name buffer remains in scope until
RenderTargetTextureDesc
is destroyed at the end of the function call.