A crash from bad memory access can happen when clearing the textures in a Texture2DArray asset.
This appears to be because the order of operations when deleting the platform data is:
```
if (PrivatePlatformData)
{
delete PrivatePlatformData;
if (PrivatePlatformData)
PrivatePlatformData = nullptr;
}
```
This comes from the functions `UTexture2DArray::InvalidateTextureSource()` and `UTexture2DArray::SetPlatformData(...)` from Texture2DArray.cpp.
1. Download the Licensee's test project (see addl info URL)
2. Launch the text project with the command-line argument "-stompmalloc"
3. Open /Game/NewTexture2DArray
4. Add the texture /Game/Black to the Source Textures
5. Clear the Source Textures via the Remove All Elements button
6. Observe the memory access exception.
How does TextureRenderTarget2D get TArray<uint8> type data?
How do I set a material as a post-processing material?
Why does the REMOVE method of map container remove elements have memory leaks?
How to delete some elements correctly when deleting an array loop?
What does the number (2152,1-34) in glsl error mean?
What is the cause of the packaging error falling back to 'GameUserSettings' in ue5?
What is the difference between Camera and CineCamera?
How does TArray loop correctly remove elements in blueprints?
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-216202 in the post.
0 |
Component | UE - Texture |
---|---|
Affects Versions | 5.4, 5.4.1 |
Target Fix | 5.5 |
Fix Commit | 32792787 |
---|
Created | May 30, 2024 |
---|---|
Resolved | May 31, 2024 |
Updated | Jul 31, 2024 |