Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
srowlands's avatar
srowlands
Explorer
10 years ago

Application.Quit() causing app to hang, any advice?

Hi,

Currently to exit our application I am calling Application.Quit(), upon calling this, the app is no longer rendered to HMD (Rift goes black) however the application is still running on desktop but is frozen and unresponsive for ~40s6seconds before closing, giving the impression to the user that its crashed. No error files/logs are created, as you would expect from a Unity crash and our output log shows no errors.

Could you offer any support or advice on this?

Thanks,
Sam

7 Replies

Replies have been turned off for this discussion
  • Same behavior is seen when using ALT-F4 to close the app, as well as right click on the taskbar and choosing close application.
  • We've let Unity know about this issue. It is most likely a bug in the timing of their main thread update when the app doesn't have focus (which it doesn't when you take off the headset). Unfortunately, the best workaround today is to enable the Run in Background checkbox in Player Settings, get the user to keep the headset on while closing the app, or force-kill the process. Hopefully it will be fixed soon.
  • @srowlands
    Hey, I'm Ed of the Unity VR team. We are looking for a repro project for this issue and I was wondering if you still had the issue or if you had a repro project that you could submit through the Unity bug reporter. If so, could you submit the bug report and then drop the bug number in a message here. Thanks!
  • @ewblais
    I'm actually experiencing a consistent crash on exit when calling Application.Quit() as well.

    The last thing outputted in the log is:

    Releasing render texture that is set to be RenderTexture.active!
     
    (Filename: C:/buildslave/unity/build/Runtime/Graphics/RenderTexture.cpp Line: 566)

    Setting up 1 worker threads for Enlighten.
      Thread -> id: 11ac -> priority: 1 
    Crash!!!
    SymInit: Symbol-Search

    Stack trace in the log is:

    0x01307E96 (FearlessDev) VREyeTextureManager::HasRenderSurface
    0x0130515F (FearlessDev) VRDevice::ReleaseEyeTextureResources
    0x01388F28 (FearlessDev) InternalDestroyRenderSurfaceD3D11
    0x0137F3E3 (FearlessDev) GfxDeviceD3D11Base::DestroyRenderSurfacePlatform
    0x013A1600 (FearlessDev) GfxDeviceWorker::RunCommand
    0x013A649E (FearlessDev) GfxDeviceWorker::Run
    0x00EFBC6F (FearlessDev) Thread::RunThreadWrapper
    0x773D38F4 (KERNEL32) BaseThreadInitThunk
    0x77A85DE3 (ntdll) RtlUnicodeStringToInteger

    I'm still trying to determine on my end if this is do to some asynchronous functionality on my end that needs to be told to stop on application quit, or if it's a Unity thing. I'm able to reproduce this issue with both 32 and 64 bit standalone builds.
  • @delphinius81
    Let me know if you are experiencing the issue on a version that isn't 5.4. We were only able to reproduce that issue with 5.4 and a fix is coming in the first patch (5.4.0p1).

    The issue that srowlands is discussing is a bit different in that the app just takes much longer than expected to close. We have other reports of this, but no reproducible projects, making it very hard to determine the actual cause of the hang. (Though we have thoughts of what the issue may be.)
  • @ewblais

    I'm using 5.4.0f3, so hopefully the upcoming patch addresses my issue then. If I encounter the hanging issue, I'll let you know.
  • @ewblais

    Hi Ed,

    This issue only seems to happen when we connect to our development servers over production, leading me to believe it is more of an issue on our end than Unity itself, I'll let you know if I can get any more info on this.

    Thanks,