On this code path, AppKit uses exit, rather than letting main run as normal. We handle most things via C++ destructors, which do run, but Qt is happier if we clean it up explicitly.
SetFrontProcess is deprecated, use NSApplication instead now we have the CocoaHelpers file.
Change away from using deprecated FSFindFolder.