Fix crash when unloading texture that has active streaming tasks

This commit is contained in:
Wojtek Figat
2023-11-27 11:53:21 +01:00
parent b3a18883ca
commit 2f4b956d78

View File

@@ -63,7 +63,6 @@ StreamingTexture::~StreamingTexture()
{
UnloadTexture();
SAFE_DELETE(_texture);
ASSERT(_streamingTasks.Count() == 0);
}
Float2 StreamingTexture::Size() const
@@ -134,11 +133,9 @@ bool StreamingTexture::Create(const TextureHeader& header)
void StreamingTexture::UnloadTexture()
{
ScopeLock lock(_owner->GetOwnerLocker());
// Release
CancelStreamingTasks();
_texture->ReleaseGPU();
_header.MipLevels = 0;
ASSERT(_streamingTasks.Count() == 0);
}