Graham,

This can happen if there is a previous call to 
-performActivityWithSynchronousWaiting:usingBlock: and the block never calls 
the completion handler. If you use that method anywhere, please make sure the 
completion handler always gets called. If you don't use the method directly, 
other methods in NSDocument may call it and failure to invoke their completion 
handlers properly may also result in these kinds of hangs.

After checking these things, if you believe your code is not at fault, please 
file a bug ASAP.

-KP

On Aug 22, 2011, at 6:26 AM, Graham Cox wrote:

> Further info, if I take out +autosavesInPlace (was overridden to return YES), 
> it works fine.
> 
> This suggests there's more to supporting this new-fangled document model to 
> allow printing to work. Any documentation spells this out?
> 
> Working in Xcode 4, the documentation viewer is so incredibly poor compared 
> to Xcode 3 I can't find anything, or rather I can't wait the ten minutes per 
> page it takes to download anything (aside: is there a way to d/l all the 
> documentation and view it locally? We don't all have gigabit fibre to the 
> node).
> 
> --G.
> 
> 
> On 22/08/2011, at 10:59 PM, Graham Cox wrote:
> 
>> When my NSDocument subclass has its printDocument: method called, Lion hangs 
>> indefinitely. Snow Leopard works fine.
>> 
>> The top of my stack looks like this:
>> 
>> #0   0x00007fff905676b6 in semaphore_wait_trap ()
>> #1   0x00007fff85ddb08e in _dispatch_semaphore_wait_slow ()
>> #2   0x00007fff881b2616 in -[NSDocument 
>> performActivityWithSynchronousWaiting:usingBlock:] ()
>> #3   0x00007fff881a2518 in -[NSDocument 
>> runModalPrintOperation:delegate:didRunSelector:contextInfo:] ()
>> #4   0x000000010009e544 in -[GCOrteliusDocument 
>> runModalPrintOperation:delegate:didRunSelector:contextInfo:] at 
>> /Users/grahamcox/Projects/Artboard/Artboard/Source/Code/GCOrteliusDocument.m:1476
>> #5   0x00000001002f5b9f in -[DKDrawingDocument printShowingPrintPanel:] at 
>> /Users/grahamcox/Projects/DrawKit/DrawKit/../Source/Code/DKDrawingDocument.m:923
>> #6   0x00007fff881a1a52 in __-[NSDocument 
>> printDocumentWithSettings:showPrintPanel:delegate:didPrintSelector:contextInfo:]_block_invoke_2
>>  ()
>> #7   0x00007fff881a95e0 in -[NSDocument _commitEditingThenContinue:] ()
>> #8   0x00007fff881a52ab in -[NSDocument 
>> _commitEditingWithDelegate:didSomethingSelector:contextInfo:thenContinue:] ()
>> #9   0x00007fff881a18bf in __-[NSDocument 
>> printDocumentWithSettings:showPrintPanel:delegate:didPrintSelector:contextInfo:]_block_invoke_1
>>  ()
>> #10  0x00007fff881b2670 in -[NSDocument 
>> performActivityWithSynchronousWaiting:usingBlock:] ()
>> #11  0x00007fff881a17d1 in -[NSDocument 
>> printDocumentWithSettings:showPrintPanel:delegate:didPrintSelector:contextInfo:]
>>  ()
>> #12  0x00007fff881a1763 in -[NSDocument printDocument:] ()
>> 
>> 
>> So it's waiting on some lock, but it never gets it. This is on the main 
>> thread, therefore my app just grinds to a halt and has to be force quit.
>> 
>> I'm at a loss as to what to do - it doesn't seem to be my bug.
>> 
>> --Graham
>> 
>> 
>> 
>> 
>> _______________________________________________
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/graham.cox%40bigpond.com
>> 
>> This email sent to graham....@bigpond.com
> 
> _______________________________________________
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/kperry%40apple.com
> 
> This email sent to kpe...@apple.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to