Re: [Pyobjc-dev] Crash when closing all documents
Brought to you by:
ronaldoussoren
From: Ronald O. <ron...@ma...> - 2009-11-24 14:15:34
|
On 24 Nov, 2009, at 4:01, Daniel Miller wrote: >> You seem to get a bus error, although the code looks fine at first glance. Could you create a small self-contained project that suffers from the same problem, that would make debugging a lot easier for me. > > Sorry for the delay in getting this to you. The example is attached. I modified the TinyTinyEdit example found in PyObjC 1.4 (and updated it slightly to use the new subclassing mechanism rather than the old NibClassBuilder.AutoBaseClass). Anyway, this little program will reproduce the error I described in the first email in this thread. Instructions to reproduce the error (execute the following at the command line after unpacking the zip file): > > Dependencies (This is what's on my system. Other versions may also produce the same error. 10.4 with PyObjC 1.4 did NOT produce this error to my knowlege.): This is a rather annoying issue, and a instance where the Python<->ObjC bridge suddenly leaps into view to mess things up. I have committed a quick workaround in the repository, but that does require a change to your code. To call the delegate method use: getattr(delegate, selector)(self, 1, context) rather than: perform_selector(delegate, selector, self, 1, context) Some notes: * You do not have to translate the selector name into a python identifier, that's a hack but is supported behaviour (that is, if I ever change PyObjC to be stricter about the names passed to __getattr__ there will be a transition period) * This does require the very latest version of PyObjC that I'm in the process of releasing. * My fix does not work with perform_selector and I don't know if I can get that version to work without a lot of work. Ronald > > Snow Leopard 10.6 > Python 2.6 > PyObjC 2.2b2 > py2app 0.4.2 (dev?) > > $ cd TinyTinyEdit > $ python setup.py py2app -A > $ dist/TinyTinyEdit.app/Contents/MacOS/TinyTinyEdit > > The TinyTinyEdit window should pop up at this point. Type something in the window to make the document dirty. Then hit [Command]+Q. You should get a traceback in your terminal window. The Apple crash reporter will probably pop up as well. > > Context: the action you performed by following the steps outlined above simulates what would happen in my application if the user were to quit the application with unsaved documents, and then clicked "Don't Save" for each unsaved document. > > ~ Daniel > > <TinyTinyEdit.zip> > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july_______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |