I've pushed a supposed fix, please give it a try.
The issue: spine-ue exposes TrackEntry instances. These are wrapped inside a USpineTrackEntry, so users of blueprints can easily access and modify them, e.g. set mix durations etc. These are UObjects and thus eligible for UE garbage collection. Normally, the garbage collection happens after the underlying TrackEntry is disposed. Disposal of a TrackEntry triggers a callback in the USpineWidget or USpineSkeletonAnimatinComponent, which will then set the USpineTrackEntry::entry
field to nullptr
. However, sometimes, under specific circumstances, that callback has no chance to be executed before the USpineTrackEntry::BeginDestroy()
method, which is triggered by the UE garbage collector, is invoked. This can lead to a situation, where the USpineTrackEntry::entry
points to a freed memory region, while USpineTrackEntry::BeginDestroy()
is trying to access the ::entry
field. That results in a crash.
The solution: do not access ::entry
in the BeginDestroy()
method. While this sounds trivial, I had to trace through everything to make sure this doesn't mess with other state, which is part of why resolving this took so long.