[ue] Closes #2537, null renderer object if UTrackEntry is destroyed.

This commit is contained in:
Mario Zechner 2024-06-04 10:40:30 +02:00
parent 73c401c2e5
commit 1534558e38
2 changed files with 9 additions and 0 deletions

View File

@ -82,6 +82,13 @@ void USpineSkeletonAnimationComponent::BeginPlay() {
trackEntries.Empty();
}
void UTrackEntry::BeginDestroy() {
if (entry) {
entry->setRendererObject(nullptr);
}
Super::BeginDestroy();
}
void USpineSkeletonAnimationComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) {
Super::Super::TickComponent(DeltaTime, TickType, ThisTickFunction);

View File

@ -219,6 +219,8 @@ public:
UPROPERTY(BlueprintAssignable, Category = "Components|Spine|TrackEntry")
FSpineAnimationDisposeDelegate AnimationDispose;
virtual void BeginDestroy() override;
protected:
spine::TrackEntry *entry = nullptr;
};