Re: [Pyobjc-dev] Kill Thread on Exception
Brought to you by:
ronaldoussoren
|
From: Ronald O. <ron...@ma...> - 2008-01-27 17:21:16
|
On 27 Jan, 2008, at 0:52, Koen Bok wrote: > Hi everyone, > > I have a (python) background thread running in our app. Whenever I get > an exception the app now crashes with a bus error without giving a > nice traceback. Is there any way to kill the thread if the main loop > gets an exception? This sounds a bit like a problem that's fixed in Python 2.6 and will have a workaround in PyObjC 2.1. In PyObjC 2.0 you'll get a hard crash in the following situation: a second thread calls one of the NSObject methods for executing a method on the main loop and there is an uncaught exception in that method. If you use Python 2.6 (which is in alpha) the program will terminate unexpectedly instead (that is, the exception will stop the runloop on the main thread and your program will therefore terminate). There's not much you can do about this, the cleanest way to avoid stopping your application is to add you're own method for executing code on the main loop and have that catch all exceptions. This can easily be build on top of the NSObject version. Ronald > > > Kindest regards, > > Koen Bok > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |