In my application I am cancelling Unity's quit (eg. after Alt-F4) in order to display a quit confirmation. This will generate a lot of errors in the build exe version:
- Code: Select all
NullReferenceException: Object reference not set to an instance of an object
at TouchScript.Layers.StandardLayer.performSSUISearch (IPointer pointer, TouchScript.Hit.HitData& hit) [0x00000] in <filename unknown>:0
at TouchScript.Layers.StandardLayer.Hit (IPointer pointer, TouchScript.Hit.HitData& hit) [0x00000] in <filename unknown>:0
at TouchScript.Core.LayerManagerInstance.GetHitTarget (IPointer pointer, TouchScript.Hit.HitData& hit) [0x00000] in <filename unknown>:0
at TouchScript.Pointers.Pointer.GetOverData (Boolean forceRecalculate) [0x00000] in <filename unknown>:0
at TouchScript.Layers.UI.TouchScriptInputModule+UIStandardInputModule.ProcessUpdated (System.Object sender, TouchScript.PointerEventArgs pointerEventArgs) [0x00000] in <filename unknown>:0
at (wrapper delegate-invoke) System.EventHandler`1<TouchScript.PointerEventArgs>:invoke_void__this___object_PointerEventArgs (object,TouchScript.PointerEventArgs)
at TouchScript.Utils.EventHandlerExtensions.InvokeHandleExceptions[PointerEventArgs] (System.EventHandler`1 handler, System.Object sender, TouchScript.PointerEventArgs args) [0x00000] in <filename unknown>:0
TouchScript.Utils.EventHandlerExtensions:InvokeHandleExceptions(EventHandler`1, Object, PointerEventArgs)
I have already found out the reason: It is because there are a couple of OnApplicationQuits() in the TouchManager code which set "shuttingDown = true", while the application still has the opportunity to cancel (Application.CancelQuit()).
As a test I have removed these (there are four of them) and rebuild the project. Now the "cancel quit" button seems to work when Alt-F4 is pressed. I do not have any crashes without the shuttingDown = true removed. shuttingDown is a private variable, so it can also not be set from outside.
So I am not sure what the best solution is . But I thought I would be good to let you know about this issue.