Merge pull request #83 from rubyperrin/master

Fix rare memory leak
This commit is contained in:
Joshua (MordenTral) Statzer
2024-01-08 14:38:48 -05:00
committed by GitHub

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;