質問

が分かっていたので、スレッドによるGCDいrunloopが出ます。今ご利用方法電話AppleScriptsスAppleEvents内NSOperationQueue.時には私のアプリがクラッシュには、以下のstacktrace.

私の質問:

  • ご利用のAppleScript内NSInvocationOperationはNSBlockOperation
  • 利用AppleEvents内GCD-スレッド
  • いを加えてソース/ポートをrunloopのgcdスレッドを使用する前にAppleEvents?
  • いを加えてソース/ポートをrunloopのgcdスレッドを使用する前に[CATransactionコミット]?
  • いを加えてソース/ポートをrunloopのgcdスレッドを使用する前に[NSObject performSelectorAfterDelay...]?
  • ある場合、いかがですか?
  • できなければなCFRunLoopRunInMode(kCFRunLoopDefaultMode,5.0,false);///30の定義のタイムアウトのappleeventディスクリ?
..

Thread 9: Dispatch queue: com.apple.root.default-priority
0 libSystem.B.dylib 0x00007fff88276e82 semaphore_wait_signal_trap 10
1 libSystem.B.dylib 0x00007fff8827c3cd pthread_mutex_lock 469
2 com.apple.applescript 0x000000011d3d461f AppleScriptComponent 50
3 com.apple.applescript 0x000000011d3edbcc AGenericCall::Delegate(ComponentInstanceRecord*) 46
4 com.apple.applescript 0x000000011d3ed520 AGenericManager::HandleOSACall(ComponentParameters*) 54
5 com.apple.applescript 0x000000011d3ed4b0 GenericComponent 219
6 com.apple.openscripting 0x00007fff8381c6da OSAExecuteEvent 63
7 com.apple.Foundation 0x00007fff86f320d8 -[NSAppleScript(NSPrivate) _executeAppleEvent:withMode:error:] 161
8 xxx 0x0000000100048af0 -[TCallScript callScript:withArrayOfParameters:] 480
9 xxx 0x0000000100048ffd -[TCallScript callHandler:withParameters:] 477
10 xxx 0x0000000100036032 -[ZFOpenWindowController getSafariItemForCurrentTabForWindow:] 66
11 xxx 0x00000001000346af -[ZFOpenWindowController refreshWindowList:] 1679
12 xxx 0x000000010003541c -[ZFOpenWindowController bringZFToForegroundZoomOut:orJustLinkFrontMost:toItem:] 2988
13 xxx 0x0000000100053556 __-[ZFSelectionTool openWithPreferredApplication:]_block_invoke_516 54
14 com.apple.Foundation 0x00007fff86ed87d9 -[NSBlockOperation main] 140
15 com.apple.Foundation 0x00007fff86ec906d -[__NSOperationInternal start] 681
16 com.apple.Foundation 0x00007fff86ec8d23 ____startOperations_block_invoke_2 99
17 libSystem.B.dylib 0x00007fff882b2ce8 _dispatch_call_block_and_release 15
18 libSystem.B.dylib 0x00007fff88291279 _dispatch_worker_thread2 231
19 libSystem.B.dylib 0x00007fff88290bb8 _pthread_wqthread 353
20 libSystem.B.dylib 0x00007fff88290a55 start_wqthread 13


...


Thread 11 Crashed: Dispatch queue: com.apple.root.default-priority
0 com.apple.applescript 0x000000011d40f658 BCHandleError() 182
1 com.apple.applescript 0x000000011d4059ca UASExecute1() 2546
2 com.apple.applescript 0x000000011d3dd1d5 ASExecuteEvent(AEDesc const*, unsigned int, int, unsigned int*) 695
3 ...ple.CoreServices.CarbonCore    0x00007fff85388e04 CallComponentFunction 28
4 com.apple.applescript 0x000000011d3d4cad AppleScriptComponent 1728
5 com.apple.applescript 0x000000011d3edbcc AGenericCall::Delegate(ComponentInstanceRecord*) 46
6 com.apple.applescript 0x000000011d3ed520 AGenericManager::HandleOSACall(ComponentParameters*) 54
7 com.apple.applescript 0x000000011d3ed4b0 GenericComponent 219
8 com.apple.openscripting 0x00007fff8381c6da OSAExecuteEvent 63
9 com.apple.Foundation 0x00007fff86f320d8 -[NSAppleScript(NSPrivate) _executeAppleEvent:withMode:error:] 161
10 xxx 0x0000000100048af0 -[TCallScript callScript:withArrayOfParameters:] 480
11 xxx 0x0000000100048ffd -[TCallScript callHandler:withParameters:] 477
12 xxx 0x0000000100035c67 -[ZFOpenWindowController getItemForAXDocumentOfFrontMostWindow] 119
13 xxx 0x00000001000359f1 -[ZFOpenWindowController getItemForFrontMostWindow:] 721
14 xxx 0x00000001000348ac -[ZFOpenWindowController bringZFToForegroundZoomOut:orJustLinkFrontMost:toItem:] 60
15 xxx 0x0000000100053556 __-[ZFSelectionTool openWithPreferredApplication:]_block_invoke_516 54
16 com.apple.Foundation 0x00007fff86ed87d9 -[NSBlockOperation main] 140
17 com.apple.Foundation 0x00007fff86ec906d -[__NSOperationInternal start] 681
18 com.apple.Foundation 0x00007fff86ec8d23 ____startOperations_block_invoke_2 99
19 libSystem.B.dylib 0x00007fff882b2ce8 _dispatch_call_block_and_release 15
20 libSystem.B.dylib 0x00007fff88291279 _dispatch_worker_thread2 231
21 libSystem.B.dylib 0x00007fff88290bb8 _pthread_wqthread 353
22 libSystem.B.dylib 0x00007fff88290a55 start_wqthread 13

役に立ちましたか?

解決

なお、AppleScriptコンポーネント限定のスレッドの安全性です。としての10.6で無い場合、お名前をお書き添え非メインスレッドがを自分で作成する必要がありますの新しいComponentInstanceれます。思ってこんな風にしてできるんだOSAKit、そうでないする必要がありまリゾートのgnarly炭素APIに含まれています。何が最高かっているという名称を使うようにな例ありませユーザによって提供されたスクリプトは、スクリプトハードコードには、アプリケーションから利用し、その意欲を走行したいNSOperationQueue).

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top