New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[godot] Memory Corruption in Custom Skins #2489
Comments
To reproduce: add a button with this script on it to the mix and match example scene and press the button:
|
same bug i think: |
same bug: #2185 |
Also crashes godot 4.1, ie: this https://spine-godot.s3.eu-central-1.amazonaws.com/4.1/4.1.3-stable/godot-editor-linux.zip |
Note: using 'copy skin' instead of 'add skin' doesnt crash What is the difference? Internal code looks almost identical except for the way mesh attachments are handled. |
Sorry for this taking so long. Attachments use a reference counting mechanism so they an be shared between skin instances. There was a bug with respect to the handling of this system (part of spine-cpp) in spine-godot. This was quite hard to track down. This should be fixed in the 4.2 branch now. Thanks for reporting. |
The SpineAttachment destructor would dereference the spine::Attachment. However, the set_spine_object() call doesn't increase the reference count. This can lead to the attachment being deallocated too early.
EDIT:
TL;DR
add_skin() is broken
copy_skin() works
The Mix and Match example crashes in the Godot 3.5 editor downloaded from esoteric's website if you reload the scene containing the custom skin. I have an address sanitizer stack trace from a similar game where we load between 2 scenes using custom skins:
The text was updated successfully, but these errors were encountered: