Skip to content
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

Fix segfaults in skin editor #42

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jonri
Copy link
Contributor

@jonri jonri commented Apr 7, 2024

This fixes two crashes I observed in the skin editor:

  1. The ThreadedDeclarationTreePopulator has public functions used by SkinEditorTreeView that eventually call ThrowIfCancellationRequested(), which is only valid to do when called by the worker thread. I added a check that simply returns from that function when it's not called on the worker thread.

  2. GlobalModelSkinCache().renameSkin() appears to have a side effect that clears out the _skin member variable. This variable was referenced afterwards causing a crash. I reworked that code to cache the name and restore the _skin member afterwards.

This fixes the crashes, but it's just the tip of the iceberg when it comes to the usability of the skin editor (at least on Linux).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant