Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Wrap with null check to avoid crash bug on quit for deployments #666

Merged
merged 2 commits into from
Feb 13, 2019

Conversation

BenNaccarato
Copy link
Contributor

Description

There was a crash bug due to having a null netdriver when attempting to quit from a built out client. Adding a null check before the call stops this crash arising.

Tests

Tested on shooter game, in editor, and in playtest (13/02/19 - will wait until QA confirm it doesn't occur when using this fix before merging it.)

Primary reviewers

@m-samiec @joshuahuburn

@improbable-prow-robot improbable-prow-robot added the size/XS Denotes a PR that changes 0-14 lines, ignoring generated files. label Feb 13, 2019
@BenNaccarato
Copy link
Contributor Author

Quick note, this crash happens if you quit via the UI, or Alt-F4 out

@padhansell
Copy link
Contributor

Ah man. It would be much easier if these events were on the SpatialWorkerConnection rather than the NetDriver because the lifetimes are totally different. With the null check we avoid the crash but effectively lose the OnDisconnect callback on game exit

@improbable-valy
Copy link
Contributor

@padhansell in this case, disconnection from Spatial happens as a result of quitting the game. My understanding was that the callbacks were meant to trigger some game logic when the disconnection is triggered by Spatial while the client is still alive.
What would be a scenario where we'd still want to execute the disconnection callback on client shutdown?

@BenNaccarato BenNaccarato merged commit 61ed433 into master Feb 13, 2019
@BenNaccarato BenNaccarato deleted the bugfix/crash-on-quit branch February 13, 2019 14:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
size/XS Denotes a PR that changes 0-14 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants