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: #2802 NetworkManager uses OnDestroy for shutdown instead of OnApplicationQuit #3935

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

miwarnec
Copy link
Collaborator

Copy link
Contributor

@imerr imerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Transport still has the same issue, it currently shuts down in OnApplicationQuit, that'd need to be covered too to fix the issue

public virtual void OnApplicationQuit()
{
// stop transport (e.g. to shut down threads)
// (when pressing Stop in the Editor, Unity keeps threads alive
// until we press Start again. so if Transports use threads, we
// really want them to end now and not after next start)
Shutdown();
}

// fixes: https://github.com/MirrorNetworking/Mirror/issues/2802
// DEPRECATED 2024-10-29
[Obsolete("Override OnDestroy instead of OnApplicationQuit. Fixes: https://github.com/MirrorNetworking/Mirror/issues/2802")]
public virtual void OnApplicationQuit() => OnDestroy();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to call OnDestroy twice?
Empty body would be better imo

@miwarnec miwarnec merged commit af133e6 into master Oct 29, 2024
@miwarnec miwarnec deleted the fix_2802 branch October 29, 2024 14:06
MrGadget1024 added a commit that referenced this pull request Oct 29, 2024
miwarnec added a commit that referenced this pull request Dec 3, 2024
MrGadget1024 added a commit that referenced this pull request Dec 3, 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