Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Reedbeta's avatar
Reedbeta
Honored Guest
11 years ago

libovr interferes with WM_QUIT and clean shutdown

In Windows, to shut down an app cleanly, you're supposed to exit the message loop when you see a WM_QUIT message. This message usually gets posted upon closing the main window and signals to the OS that the app is going away.

However, I've found that libovr somehow interferes with WM_QUIT. I'm using DK2 direct mode and it appears that after calling ovrHmd_AttachToWindow(), my message loop never sees WM_QUIT. I've verified that it still gets posted upon closing the main window, but it never makes it to the message loop - so the app never shuts down and remains a zombie process. This doesn't happen if I comment out the call to ovrHmd_AttachToWindow().

I've worked around this by early exiting the message loop if my main window has gone away, but it would be nice to get this fixed. I assume libovr does not intend to screw around with my messages. :)

2 Replies

  • Cgpnz's avatar
    Cgpnz
    Honored Guest
    Ouch, this basic windows API lack of knowledge. What other basic mistakes does the runtime involve?
    This needs to be open sourced NOW! The collective knowledge in the community really is greater than a few developers in OVR.
  • I don't seem to have this issue, but I'll double check when I get home. Off the top of my head I receive a WM_QUIT when the last window is closed and my engine calls PostQuitMessage. I may be doing things differently so just in case, the order of my messages (I think) is:

    1) User closes window
    2) WM_CLOSE received.
    3) Engine destroys window
    4) WM_NCDESTROY received. If no more windows exist, engine calls PostQuitMessage
    5) WM_QUIT received. Engine exits.