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 thread crash on editor exit due to module unavailability #171 #172

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

zhaozigu
Copy link
Contributor

@zhaozigu zhaozigu commented Aug 7, 2024

Pre-check to prevent assertion failure crash #171

@zhaozigu zhaozigu changed the title Fix thread crash on editor exit due to module unavailability #171 & #168 Fix thread crash on editor exit due to module unavailability #171 Aug 7, 2024
@mastercoms
Copy link
Member

mastercoms commented Aug 7, 2024

Hi, thanks for the contribution! Do you know why this is being called by the fetch worker in the first place? Shouldn't it close without updating when the editor is exiting? I think that would be a better fix.

@zhaozigu
Copy link
Contributor Author

zhaozigu commented Aug 7, 2024

Hi, thanks for the contribution! Do you know why this is being called by the fetch worker in the first place? Shouldn't it close without updating when the editor is exiting? I think that would be a better fix.

It's likely due to an unstable network connection combined with the time lag caused by multi-threading. This results in the update operation occurring after the user has already closed the editor.

@mastercoms
Copy link
Member

mastercoms commented Aug 7, 2024

Maybe it's better to keep a reference in the worker thread to the module, and release it on each update loop. I think this will hold the module until deref. That way we won't have to worry about any function we are calling needing to handle module.

@zhaozigu
Copy link
Contributor Author

zhaozigu commented Aug 7, 2024

Perhaps we could consider using Unreal's subsystems, which would make the module's lifecycle simpler and more controllable. Of course, this is just my immature suggestion, as my understanding of this plugin's implementation is still quite limited.

@mastercoms
Copy link
Member

That may be good! I will accept this PR for now though, if you add a TODO comment about more robust module handling.

@zhaozigu
Copy link
Contributor Author

zhaozigu commented Aug 7, 2024

OK. I've added a comment.

@mastercoms mastercoms merged commit 06e0ea7 into ProjectBorealis:dev Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants