简体   繁体   中英

PyobjC : Application throwing an error if we shutdown Mac

I am running a simple pyobj c app. However, if I try to shutdown the mac while the app is running, it does not close gracefully like the other apps. I noticed that if I comment out the line AppHelper.runEventLoop() , there is no issue. How do I get the eventloop to terminate gracefully in case the user tries to restart/shutdown the Mac before quitting the application.

The event loop should self terminate when the application has been asked to terminate (provided something isnt blocking the "terminate" request).

Your problem certainly has nothing to do with AppHelper.runEventLoop() the documentation clearly states that this does not return, unless an exception is thrown.

You must have something setup in place that is blocking the application from terminating. (unsaved document?, modal window?)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM