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 crash when using "Close All Tabs" #79917

Merged
merged 1 commit into from
Jul 31, 2023

Conversation

hvarga
Copy link
Contributor

@hvarga hvarga commented Jul 26, 2023

Fixes #79943.

I have fixed this in a way so that this deferred call to _set_main_scene_state is done only once at the very end after all tabs are closed.

There is a potential for further improvement which can speed-up the closing of the tabs. I could be wrong, and probably I am due to my lack of knowledge about Godot, but I don't see any need to update the editor for each of the closed tab. The update can be done only once at the end when closing of scene tabs is complete. But I will leave this decision to guys smarter then me like Tomasz Chabora who made this original refactor.

@hvarga
Copy link
Contributor Author

hvarga commented Jul 26, 2023

test_project.tar.gz

@hvarga
Copy link
Contributor Author

hvarga commented Jul 26, 2023

I have tried to not break the legacy code, and hopefully I haven't. I have tested this change manually, but it would be really good if we could have tests for the GUI as well. I can see that the tests are using mocked display server and test_macros.h has _SEND_DISPLAYSERVER_EVENT to simulate input events from mouse or keyboard. Is it possible to use this mechanism to test something like closing of editor scene tabs?

@hvarga
Copy link
Contributor Author

hvarga commented Jul 26, 2023

@YuriSizov, can we port this to 4.1 branch? I know this is not something of a blocker, but I would really like to have it on 4.1.x since I am using this version for my purposes. On the other hand, there is really nothing that keeps me on 4.1. I can always downgrade to 4.0.

But if a backport comes to mind, just note that, while the first issue reproducible on 4.1.x, the second one is only reproducible on master branch. I will add this info as well in the description. What I am trying to say is that, if someone decides to backport this change, we need to separate this into two PRs.

@YuriSizov
Copy link
Contributor

@hvarga Generally speaking, you shouldn't mix together different fixes to begin with. In this case they are closely related, so I haven't asked you to split them. But since you raise that concern yourself, it's worth a mention.

It would also be great if you open issue reports first, so PRs can be properly linked to them, especially since these are different issues affecting different versions and thus different users. It doesn't mean you need to wait for something, you can just open the report and the relevant PR at the same time.

We normally cherry-pick PRs that are trivially cherry-pickable and only ask for backports if this is not the case. So that's another reason to make separate PRs for separate fixes.

editor/editor_node.cpp Outdated Show resolved Hide resolved
editor/editor_node.cpp Outdated Show resolved Hide resolved
@hvarga
Copy link
Contributor Author

hvarga commented Jul 27, 2023

Understood. I will separate this into two PRs and also open issues for them.

@hvarga
Copy link
Contributor Author

hvarga commented Jul 27, 2023

@YuriSizov I am done with separating this change into two PRs. The second fix is done in #79945. Sorry for the noise.

@hvarga hvarga requested a review from YuriSizov July 27, 2023 07:39
@YuriSizov YuriSizov added the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Jul 27, 2023
@YuriSizov YuriSizov requested a review from KoBeWi July 27, 2023 09:37
@YuriSizov
Copy link
Contributor

Sorry for the noise.

No problem at all! You did a lot of work identifying and describing problems despite this being your first engine contribution. Hiccups can happen, and it all looks perfect now :)

@YuriSizov YuriSizov changed the title Fix scene tab close Fix crash when using "Close All Tabs" Jul 31, 2023
@YuriSizov YuriSizov merged commit f158981 into godotengine:master Jul 31, 2023
13 checks passed
@YuriSizov
Copy link
Contributor

Thanks! And congrats on your first merged Godot PR!

@hvarga hvarga deleted the fix-scene-tab-close branch August 1, 2023 14:22
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.1.2.

@YuriSizov YuriSizov removed the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Godot editor crash with signal SIGSEGV when "Close All Tabs" is selected
3 participants