Re: [Pyobjc-dev] Some PyObC tweaks for using EOF and custom frameworks
Brought to you by:
ronaldoussoren
From: Pierce T. W. I. <pi...@ma...> - 2003-08-10 14:56:36
|
>> >> 1. I have to touch NSCalendarDate after loading Foundation and >> before loading any other frameworks via loadBundle. I think this >> causes +initialize for the various Foundation classes early on, which >> probably should have been done by the "import Foundation" step >> originally, but that might be tough. I'm using NSCalendarDate because >> NSCalendarDate had a +initialize method that was deadlocking, but >> using it seemed to fix everything. >> >> Doing this after the loadBundle call caused problems with both >> Foundation and the loaded frameworks. >> >> i.e I have to do some VOODOO: >> >> import objc >> import Foundation >> >> #VOODOO >> from Foundation import NSCalendarDate >> NSCalendarDate.date().description() >> >> objc.loadBundle("EOAccess",globals(),bundle_path="/System/Library/ >> Frameworks/EOAccess.framework") > > This is odd. I'll try to reproduce this with another framework, I > don't think we have old WebObjects CD's lying around at the office. I > noticed you can download a trial version of WebObjects 5.x, but that > seems to be java based. This is the sample run from the lock up that happens. It's not all frameworks that do this, I think they have to have some categories on some foundation classes or something. Which makes a certain amount of sense, because its related to +initialize. The work around might be just to trigger an initialize during the loadBundle call via [Class self] on one of the imported classes. 1000 Thread_0e03 1000 start 1000 _start 1000 Py_Main 1000 PyRun_SimpleFileExFlags 1000 run_node 1000 PyEval_EvalCode 1000 PyEval_EvalCodeEx 1000 eval_frame 1000 call_function 1000 do_call 1000 PyObject_Call 1000 PyObjCSelector_Required 1000 ObjC_FFICaller 1000 ffi_call 1000 ffi_call_DARWIN 1000 +[NSCalendarDate distantPast] 1000 -[NSCalendarDate initWithTimeIntervalSinceReferenceDate:] 1000 -[NSCalendarDate initWithTimeIntervalSinceReferenceDate:] 1000 objc_msgSend 1000 _class_lookupMethodAndLoadCache 1000 _destroyInitializingClassList 1000 _destroyInitializingClassList 1000 +[NSTimeZone(Extra) initialize] 1000 +[NSTimeZone(Extra) initialize] 1000 objc_msgSend 1000 _class_lookupMethodAndLoadCache 1000 _destroyInitializingClassList 1000 +[NSTimeZone(Extra) initialize] 1000 -[NSLock lock] 1000 pthread_mutex_lock 1000 semaphore_wait_trap 1000 semaphore_wait_trap [STACK TOP] |