I need to quit an app. The following code has worked for years. Now I’ve got the second report that after executing the code the app is still running:
'try to quit the app
dim maxProcess as ProcessMBS = Utility.getProcess(theBundleID)
if maxProcess = Nil then Return ""
dim theResult as Integer = maxProcess.QuitProcess
if theResult <> 0 then
Globals.theErrorLog.logitem(currentMethodName + " error: " + Str(theResult))
Return Replace(kErrorQuit, "<<appname>>", AppCommon.getInstallationAppName)
end if
Thread.SleepCurrent(100)
'final check
maxProcess = Utility.getProcess(theBundleID)
if maxProcess <> Nil then
Globals.theErrorLog.logitem(currentMethodName + " app not quit")
Return Replace(kErrorQuit, "<<appname>>", AppCommon.getInstallationAppName)
end if
theResult is 0 and the session log has “app not quit” in it.
What can I do to quit the app? Xojo 2021r2.1. macOS Monterey