From f9dd118cf6e528e121e3ca48f6c7a5cff2c9d10d Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Sat, 13 Mar 2010 23:04:42 +0000 Subject: Don't attempt to release the print thread at the beginning of a print operation. --- Source/SPPrintController.m | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/SPPrintController.m b/Source/SPPrintController.m index 64354076..dd990cad 100644 --- a/Source/SPPrintController.m +++ b/Source/SPPrintController.m @@ -71,6 +71,9 @@ NSPrintOperation *op = [NSPrintOperation printOperationWithView:[[[printWebView mainFrame] frameView] documentView] printInfo:printInfo]; + // Perform the print operation on a background thread + [op setCanSpawnSeparateThread:YES]; + // Add the ability to select the orientation to print panel NSPrintPanel *printPanel = [op printPanel]; @@ -91,16 +94,14 @@ didRunSelector:nil contextInfo:nil]; - [self endTask]; + if ([self isWorking]) [self endTask]; } /** * Loads the print document interface. The actual printing is done in the doneLoading delegate. */ - (IBAction)printDocument:(id)sender -{ - if (printThread) [printThread release]; - +{ [self startTaskWithDescription:NSLocalizedString(@"Generating print document...", @"generating print document status message")]; BOOL isTableInformation = ([tableTabView indexOfTabViewItem:[tableTabView selectedTabViewItem]] == 3); -- cgit v1.2.3