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

[Editor] Fix crash when editing TileMap #90849

Merged
merged 1 commit into from
May 28, 2024

Conversation

AThousandShips
Copy link
Member

@AThousandShips AThousandShips commented Apr 18, 2024

Crash caused by deferred calls to redraw, combined with objects being freed

@AThousandShips
Copy link
Member Author

AThousandShips commented Apr 18, 2024

Marking as draft for the moment and will change the general code to use Ref instead of pointers for general safety

Will do this broader change as a separate future PR if desired, just keeping this one simple for now

@AThousandShips AThousandShips marked this pull request as ready for review April 18, 2024 13:15
@AThousandShips AThousandShips added the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Apr 18, 2024
@groud
Copy link
Member

groud commented Apr 22, 2024

Will do this broader change as a separate future PR if desired, just keeping this one simple for now

Using a Ref<> would be simpler and better IMO. The approach using ObjectID is mainly useful for nodes, which cannot be ref-counted if I am not mistaking. In general using Ref is safer too.

If you don't want to put more work in this right now though, I don't mind merging the PR in the current state. It's good enough to fix the crash.

@AThousandShips
Copy link
Member Author

I'll swap out these specific cases to Ref and do wider changes in a subsequent PR, but the change to ref for these is trivial, will do later today

@AThousandShips AThousandShips force-pushed the tile_edit_fix branch 2 times, most recently from 057c3de to 900c5a3 Compare April 22, 2024 09:31
@akien-mga akien-mga merged commit f7b9cdc into godotengine:master May 28, 2024
16 checks passed
@AThousandShips AThousandShips deleted the tile_edit_fix branch May 28, 2024 14:36
@akien-mga
Copy link
Member

Thanks!

@AThousandShips
Copy link
Member Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release crash topic:editor topic:2d
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TileMapEditor crashes sometimes when switching scene tabs
3 participants