rive-app / rive-unreal

MIT License
77 stars 4 forks source link

Fix dangling pointer used for texture debug name #82

Closed TheLastBanana closed 3 months ago

TheLastBanana commented 3 months ago

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.

TheLastBanana commented 3 months ago

Switched this to the development branch since it's more up to date.