PyDocURLProtocol example (was: [Pyobjc-dev] crasher demo app)
Brought to you by:
ronaldoussoren
From: Bob I. <bo...@re...> - 2004-03-29 16:40:18
|
On Mar 25, 2004, at 6:03 PM, Bob Ippolito wrote: > > On Mar 25, 2004, at 4:23 PM, Ronald Oussoren wrote: > >> >> On 25-mrt-04, at 22:08, Burris T. Ewell wrote: >> >>> First off, I appreciate all of the help here... >>> >>> On Mar 25, 2004, at 12:19 PM, Ronald Oussoren wrote: >>>> If I remove those calls the application runs longer, e.g. it didn't >>>> crash yet :-) >>> >>> I don't think that's it... I tried that, holding a reference to the >>> cell, and also retaining the application delegate that holds >>> references to the controller objects. Still, inside the cell, the >>> controller attribute disappears inside drawInteriorWithFrame. Here >>> is a traceback from the full application, which is pretty much the >>> same as the demonstration. This shouldn't be possible since the >>> cell sets self.controller inside of init() and nowhere else is the >>> attribute removed. >> >> Hmm, doesn't NSTableView use -copy? That might explain why >> self.controller disappears. >> >> There's definitly something fishy going on, > > There's fishy things with threads in PyObjC in general.. try this, for > example (I just ran into this bug today): > > http://undefined.org/~bob/PyURLProtocol_broken.tgz > > My guess is that it doesn't release the GIL when doing the call, so > when it gets the callback it can't acquire the GIL and deadlocks. Just to follow this up, the barrage of recent GIL-related checkins have fixed this issue and I've created an example that uses it: Examples/PyDocURLProtocol The GUI sucks, because it's just a web-browser-with-no-support-code, but I think it demonstrates the URL protocol well enough. Feel free to spice it up. -bob |