Note that destroying the GameObject and/or
Context created by an
Instance is supported and will successfully tear down the
Context; however, if GetInstance is subsequently queried, it will simply lazily create a new
Context. This has particular implications on the use of
Instance Contexts during app teardown, where order of destruction is not guaranteed and attempts to access an existing
InstanceContext may result in the creation of a new
Context instead if the prior
Context happens to have been destroyed first. For this reason, if access to a specific
Context is needed in teardown logic (or to a lesser degree any other logic), you should locally cache a reference to the underlying
Context and only invoke GetInstance if the old instance is destroyed and you specifically need a reference to the new one.