It’s me again… I apologize by so much troubles on a single day.
Getting a weird break on 4.7 UObject::ProcessEvent L799
I didn’t got this on 4.6.1, unfortunatelly it’s not easily replicable, so I’ll try to provide as much info I could.
I’ve created a simple class to ease Async Static Meshes loading, it’s just an Object that holds a FStringAssetreference, a StaticMesh pointer, a method to be assigned on the FstreamableManager and a delegate to be broadcast when the process finishes and this way tell the blueprint that my StaticMesh is already loaded and could be assigned somewhere because at this point the “pointer” will be filled.
here is the .h
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FStaticMeshLoadedDelegate);
/**
*
*/
UCLASS(BlueprintType)
class GAME_API UVAsyncStatMeshContainer : public UObject
{
GENERATED_UCLASS_BODY()
public:
UVAsyncStatMeshContainer();
FStringAssetReference StaticMeshToLoad;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Resource")
UStaticMesh * LoadedMesh;
UFUNCTION(BlueprintCallable, Category = StateControl)
void MeshFinishedLoad();
UPROPERTY(BlueprintAssignable, BlueprintReadWrite, Category = "Asset Loading")
FStaticMeshLoadedDelegate OnMeshLoaded;
};
and here the .cpp
UVAsyncStatMeshContainer::UVAsyncStatMeshContainer(const class FObjectInitializer& PCIP) : Super(PCIP)
{
}
void UVAsyncStatMeshContainer::MeshFinishedLoad()
{
check(StaticMeshToLoad.ResolveObject() != nullptr)
{
UObject* NewLoadedStaticMesh = StaticMeshToLoad.ResolveObject();
LoadedMesh = Cast<UStaticMesh>(NewLoadedStaticMesh);
OnMeshLoaded.Broadcast();
}
}
It’s used on my BP this way:
The trouble is: I don’t have any “OnMouseLeaves” Events on my inventory slots anywhere, they are all tested with “IsHovered” on buttons only…
Now, the weirdest thing…
I have this SlotClass on 2 usages now (both with Async Loads), one is used with a ModularPawn instance that doesn’t produces the crash.
But, into another place, it procuces the error on the 4.7 version…
The Modular Pawn is completely implemented on C++ also the async loads are assigned by similar methods but trough code, to the weapons on the other hand I did exposed the method to Blueprint:
But this is just exposing this:
void UVItemsMeshData::AssignAsyncStatMeshLoad(UVAsyncStatMeshContainer * WaitingMesh, int32 DesiredID)
{
TArray<FStringAssetReference> ObjToLoad;
FStreamableManager& BaseLoader = UVTypeandHelpers::Get().AssetLoader; // Gets the asset Loader
WaitingMesh->StaticMeshToLoad = StatMeshesList[DesiredID].StaticMeshRes.ToStringReference(); // Gets the path
ObjToLoad.AddUnique(WaitingMesh->StaticMeshToLoad);
BaseLoader.RequestAsyncLoad(ObjToLoad, FStreamableDelegate::CreateUObject(WaitingMesh, &UVAsyncStatMeshContainer::MeshFinishedLoad));
}
Is there any idea about what could be causing the crash? What’s the right thing? Should this work as on 4.6 or is this just appearing now because you did fixed something?
Thank you.