mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
[ue] Closes #2557, dereference UTrackEntry in TrackEntries
This commit is contained in:
parent
ed0206dde3
commit
0fd206d3ca
@ -35,6 +35,7 @@
|
||||
using namespace spine;
|
||||
|
||||
void UTrackEntry::SetTrackEntry(TrackEntry *trackEntry) {
|
||||
if (entry) entry->setRendererObject(nullptr);
|
||||
this->entry = trackEntry;
|
||||
if (entry) entry->setRendererObject((void *) this);
|
||||
}
|
||||
@ -80,6 +81,11 @@ USpineSkeletonAnimationComponent::USpineSkeletonAnimationComponent() {
|
||||
|
||||
void USpineSkeletonAnimationComponent::BeginPlay() {
|
||||
Super::BeginPlay();
|
||||
for (UTrackEntry* entry : trackEntries) {
|
||||
if (entry && entry->GetTrackEntry()) {
|
||||
entry->GetTrackEntry()->setRendererObject(nullptr);
|
||||
}
|
||||
}
|
||||
trackEntries.Empty();
|
||||
}
|
||||
|
||||
|
||||
@ -108,6 +108,11 @@ void USpineWidget::SynchronizeProperties() {
|
||||
} else {
|
||||
slateWidget->SetData(nullptr);
|
||||
}
|
||||
for (UTrackEntry* entry : trackEntries) {
|
||||
if (entry && entry->GetTrackEntry()) {
|
||||
entry->GetTrackEntry()->setRendererObject(nullptr);
|
||||
}
|
||||
}
|
||||
trackEntries.Empty();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user