callback exception catch.#8
Open
dghn wants to merge 1 commit intoakbiggs:masterakbiggs/UnityTimer:masterfrom
dghn:timer-callback-exception-fixdghn/UnityTimer:timer-callback-exception-fixCopy head branch name to clipboard
Open
callback exception catch.#8dghn wants to merge 1 commit intoakbiggs:masterakbiggs/UnityTimer:masterfrom dghn:timer-callback-exception-fixdghn/UnityTimer:timer-callback-exception-fixCopy head branch name to clipboard
dghn wants to merge 1 commit intoakbiggs:masterakbiggs/UnityTimer:masterfrom
dghn:timer-callback-exception-fixdghn/UnityTimer:timer-callback-exception-fixCopy head branch name to clipboard
Conversation
|
try/catches are expensive in Unity (or any game engine) and even more brutal when called in the Update() method, therefore at least in production code highly recommended to avoid them at all costs. Unfortunately I don't have any quick suggestions or time to dig in (busy with my own mess) but maybe someone else can chime in. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Exception on any callback causes timer not to complete. It can't proceed to done state, and that timer can't be removed from timers list and update loop of Timer is spammed with exceptions that is caught by Unity run-time which is good but still a big issue.
Exception could be logged to the user or thrown upwards, left to the maintainer.