Skip to content

Commit

Permalink
Merge pull request #31 from stlnkm/master
Browse files Browse the repository at this point in the history
Fix memory leak & issue #26
  • Loading branch information
hxhb authored Jan 28, 2022
2 parents d4c2068 + 70c5745 commit abb2932
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1391,16 +1391,24 @@ bool UFlibHotPatcherCoreHelper::SerializeAssetRegistry(const FString& PlatformNa
AssetRegistry.InitializeTemporaryAssetRegistryState(State, SaveOptions, true);
for(const auto& AssetPackagePath:PackagePaths)
{
if(State.GetAssetByObjectPath(FName(*AssetPackagePath)))
if (State.GetAssetByObjectPath(FName(*AssetPackagePath)))
{
UE_LOG(LogHotPatcherCoreHelper,Warning,TEXT("%s Alway add to AssetRegistryState!"),*AssetPackagePath);
UE_LOG(LogHotPatcherCoreHelper, Warning, TEXT("%s already add to AssetRegistryState!"), *AssetPackagePath);
continue;
}
FAssetData* AssetData = new FAssetData();
if(UFlibAssetManageHelper::GetSingleAssetsData(AssetPackagePath,*AssetData))
if (UFlibAssetManageHelper::GetSingleAssetsData(AssetPackagePath, *AssetData))
{
if (AssetPackagePath != AssetData->ObjectPath.ToString())
{
UE_LOG(LogHotPatcherCoreHelper, Warning, TEXT("%s is a redirector of %s, skip!"), *AssetPackagePath, *AssetData->ObjectPath.ToString());
delete AssetData;
continue;
}
State.AddAssetData(AssetData);
continue;
}
delete AssetData;
}
// Create runtime registry data
FArrayWriter SerializedAssetRegistry;
Expand Down

0 comments on commit abb2932

Please sign in to comment.