Fix rare memory leak

This commit is contained in:
ruby
2024-01-02 15:23:52 +00:00
parent d5e5c73ce6
commit 2045c91b1d

View File

@@ -346,16 +346,15 @@ UTexture2D * UAdvancedSteamFriendsLibrary::GetSteamFriendAvatar(const FBPUniqueN
FMemory::Memcpy(MipData, (void*)oAvatarRGBA, Height * Width * 4);
PlatformData->Mips[0].BulkData.Unlock();
// Original implementation was missing this!!
// the hell man......
delete[] oAvatarRGBA;
//Setting some Parameters for the Texture and finally returning it
PlatformData->SetNumSlices(1);
Avatar->NeverStream = true;
//Avatar->CompressionSettings = TC_EditorIcon;
}
// Free RGBA buffer regardless of whether it was used or not
delete[] oAvatarRGBA;
Avatar->UpdateResource();
Result = EBlueprintAsyncResultSwitch::OnSuccess;