Re: [Pyobjc-dev] KV Observers caused Abort Trap (or: when to remove them)
Brought to you by:
ronaldoussoren
From: Bob I. <bo...@re...> - 2005-04-08 22:27:51
|
There wasn't an announcement, it's not an "official" release. 1.3.1 will be. On Apr 8, 2005, at 3:14 PM, Clive Jevons wrote: > Hey there, > > Really does seem to have been that we were using different PyObjC > versions. I've just installed 1.3 today (was using 1.3b1) ... must > have missed that announcement :) Anyway - with that installed and > running the exact same code and sequence of clicks I don't get the > Abort Trap any more :D > > Cheers again for all the help, > C > > On 6 Apr 2005, at 21:13, Ronald Oussoren wrote: > >> >> On 6-apr-05, at 10:33, Clive Jevons wrote: >> >>> Right ... I've uploaded something which exhibits this behavior to: >>> http://bludgeoned.net/dirty.tgz >>> >>> The app is written against a MySQL 4.0 DB using MySQL-python-1.2.0 >>> ... hope you've got those - if its a problem, let me know, and I'll >>> try and come up with something else ... >> >> I've installed both (the first using darwinport, the second using >> Bob's mpkg). I've tested using the stock Python in 10.3.8. >> >> Small examples using readily available opensource software should be >> fine. U >> >>> I'm using a self-compiled Python 2.4 and PyObjC 1.3b also compiled >>> by myself running on the latest and greatest 10.3.8. >>> >>> Once untarred, change to the dirty directory (phwoar!) then: >>> >>> $ mysql -u <user> >>> ... >>> mysql > create database test_data; >>> mysql > quit >>> ... >>> $ mysql -u <user> test_data < create_db.sql >>> >>> Then start the app (you know better than I how to achieve this ;D), >>> then click load, then select an item, delete it, then save, then >>> load again - this should cause the Abort Trap (if you're running in >>> 'debug mode'). >> >> I had to load twice, then the application hung. >>> >>> You can then comment in line 130, and do the same again - should >>> work now. >>> >>> I've also tried a version where deleted data is not cached in an >>> array on the DataStore - but this leads to the same problem. In >>> TestData, you can also still see my attempt at the __del__ method. >>> Line 30 is commented out because once you comment in line 130 it >>> will cause a bus error (trying to remove observers twice). >> >> It did work for me if I enabled the removeObserver... call in __del__ >> and added 'self.deleted_data = []' in do_save (after the call to >> db_delete). Remove the observer from 'self' instead of >> 'self.data_store' also works. You might be getting a crash because >> you're removing something that isn't an observer (either by removing >> an observer twice or by removeing the wrong observer). >> >> BTW. TestData defines two versions of observeValue..., the first copy >> is ignored. > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real > users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |