I have an issue on Unreal, when my spine widgets are being Tick, sometime a fatal error happens. It seems like the UTrackEntry *uEntry = (UTrackEntry *) entry->getRendererObject(); returns an item that has been deleted by the GC. uEntry is not exactly null, but the values it contains are not good. It seems to happen after around 30s. I put to false the CallDelegates boolean in the Tick method of SpineWidget but it doesn't.

This is the blueprint I use to update the Spine displayed:


I also tried this but it doesn't change anything:

My error message :

VCRUNTIME140
UnrealEditor_SpinePlugin!TMulticastScriptDelegate<FWeakObjectPtr>::ProcessMulticastDelegate<UObject>() [C:\Program Files\Epic Games\UE_5.0\Engine\Source\Runtime\Core\Public\UObject\ScriptDelegates.h:485]
UnrealEditor_SpinePlugin!callbackWidget() [C:\Users\Joachim\Documents\GitHub\[ProjectName]\Plugins\SpinePlugin\Source\SpinePlugin\Private\SpineWidget.cpp:58]
UnrealEditor_SpinePlugin!spine::EventQueue::drain() [C:\Users\Joachim\Documents\GitHub\[ProjectName]\Plugins\SpinePlugin\Source\SpinePlugin\Public\spine-cpp\src\spine\AnimationState.cpp:277]
UnrealEditor_SpinePlugin!spine::AnimationState::apply() [C:\Users\Joachim\Documents\GitHub\[ProjectName]\Plugins\SpinePlugin\Source\SpinePlugin\Public\spine-cpp\src\spine\AnimationState.cpp:500]
UnrealEditor_SpinePlugin!USpineWidget::Tick() [C:\Users\Joachim\Documents\GitHub\[ProjectName]\Plugins\SpinePlugin\Source\SpinePlugin\Private\SpineWidget.cpp:137]
UnrealEditor_SpinePlugin!USpineWidget::execTick() [C:\Users\Joachim\Documents\GitHub\[ProjectName]\Plugins\SpinePlugin\Intermediate\Build\Win64\UnrealEditor\Inc\SpinePlugin\SpineWidget.gen.cpp:120]

Any help would be welcomed, thank you

    Related Discussions
    ...

    Sorry for the trouble! We'll try to reproduce this issue and see if we can find a fix.

    Update, I managed to prevent the Garbage Collector from deleting my tracks by adding them in an array. Have I done something wrong for the GC to delete the played tracks ?

    JoachimK Sorry for the late confirmation, but I reproduced the EventGraph shown in the last of the screenshots you posted and could not reproduce the same error.
    I tried it first with UE5.2 and was not able to reproduce it, so I tried it again with UE5.0 and was not able to reproduce it either.
    To clarify, I set up nodes for the UmgRaptor blueprint which used in the example level "07-umg-ui" in the example project that comes with the spine-ue4 runtime as follows and let it play for a while:

    So could you please send us a minimal UE project that can reproduce the problem via email?: contact@esotericsoftware.com
    Please include the URL of this forum thread in the email so we know the context. Then we can take a look at what's wrong.

    4 months later

    Hello, sorry to reply this old discussion. I encountered a very same crash. Unfortunately, I can not reproduce it in a minimal UE project. I added reference for UTrackEntry that USpineWidget::SetAnimation returns and in this way fixed the problem temporarily. Do you have any idea on why this GC happened?

    As far as I see all entries are stored in trackEntries when created, and there are only 3 places that empties this TSet. trackEntries.Empty() call in USpineWidget:: DisposeState() and USpineWidget::CheckState() seems reasonable, but I'm a little confused why you call it in USpineWidget::SynchronizeProperties()(where a USpineWidget::CheckState() has already been called). Is there any chance that some entries' reference are deleted here in USpineWidget::SynchronizeProperties() so they are GCed later on?

    4 months later

    When the SpineWidget was removed, I removed all of the TrackEntry and ran the Tick(0.0F, false) node, and no GC errors occurred.
    It is speculated that this was caused by the TrackEntry in the SpineWidget that was previously used not being GC properly.

    21 days later

    I have just updated my unreal version from 5.0 to 5.4, and the spine runtime along with it, and I'm also now having random crashes related to the TrackEntry (either when I close the PIE editor, or sometimes during play when opening and closing widgets that contain a spine widget).

    Is the code in that github issue a proper fix? Will try and implement it now and see how it goes.

    The error below:
    Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffffffffffff

    UnrealEditor_SpinePlugin!UTrackEntry::BeginDestroy() [C:\Users\Thomas\Documents\Unreal Projects\FPS\Plugins\SpinePlugin\Source\SpinePlugin\Private\SpineSkeletonAnimationComponent.cpp:87]
    UnrealEditor_CoreUObject
    UnrealEditor_CoreUObject
    UnrealEditor_CoreUObject
    UnrealEditor_Engine
    UnrealEditor_Engine
    UnrealEditor_UMGEditor
    UnrealEditor_UnrealEd
    UnrealEditor_UnrealEd
    UnrealEditor_UnrealEd
    UnrealEditor
    UnrealEditor
    UnrealEditor
    UnrealEditor
    UnrealEditor
    UnrealEditor
    kernel32
    ntdll

    Just tried modifying the code with the one from that issue on github, but still getting a crash on the same line in beginDestroy() where it calls entry->setRendererObject(nullptr);

    Have also tried the addUnique trick in blueprints posted above, but no luck with that either 🙁

    2 months later

    Mario 我遇到和他同样的问题报错,我觉得Spine运行时自身的问题并非特定项目或资源问题

    As stated by Misaki in the other thread, we'll need a minimal project that reproduces the issue.