diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPExportInitializer.m | 5 | ||||
-rw-r--r-- | Source/SPXMLExporter.m | 10 |
2 files changed, 6 insertions, 9 deletions
diff --git a/Source/SPExportInitializer.m b/Source/SPExportInitializer.m index 0ceccbd6..20b38c5e 100644 --- a/Source/SPExportInitializer.m +++ b/Source/SPExportInitializer.m @@ -355,9 +355,6 @@ } singleFileHandle = [self getFileHandleForFilePath:[[exportPathField stringValue] stringByAppendingPathComponent:[filename stringByAppendingPathExtension:@"xml"]]]; - - // Write the file header - [self writeXMLHeaderToFileHandle:singleFileHandle]; } // Start the export process depending on the data source @@ -541,7 +538,7 @@ if ((exportSource == SPTableExport) && exportToMultipleFiles && (exportTableCount > 0)) { filename = [[exportPathField stringValue] stringByAppendingPathComponent:table]; - fileHandle = [self getFileHandleForFilePath:filename]; + fileHandle = [self getFileHandleForFilePath:[filename stringByAppendingPathExtension:@"xml"]]; // Write the file header [self writeXMLHeaderToFileHandle:fileHandle]; diff --git a/Source/SPXMLExporter.m b/Source/SPXMLExporter.m index 94cfec05..de43560e 100644 --- a/Source/SPXMLExporter.m +++ b/Source/SPXMLExporter.m @@ -60,7 +60,6 @@ { @try { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - NSAutoreleasePool *xmlExportPool = [[NSAutoreleasePool alloc] init]; NSArray *xmlRow = nil; NSString *dataConversionString = nil; @@ -121,7 +120,7 @@ if ([self xmlDataArray]) currentRowIndex++; // Drop into the processing loop - xmlExportPool = [[NSAutoreleasePool alloc] init]; + NSAutoreleasePool *xmlExportPool = [[NSAutoreleasePool alloc] init]; currentPoolDataLength = 0; @@ -217,14 +216,14 @@ // Inform the delegate that the export's progress has been updated [delegate performSelectorOnMainThread:@selector(xmlExportProcessProgressUpdated:) withObject:self waitUntilDone:NO]; - // If an array was supplied and we've processed all rows, break - if ([self xmlDataArray] && totalRows == currentRowIndex) break; - // Drain the autorelease pool as required to keep memory usage low if (currentPoolDataLength > 250000) { [xmlExportPool release]; xmlExportPool = [[NSAutoreleasePool alloc] init]; } + + // If an array was supplied and we've processed all rows, break + if ([self xmlDataArray] && totalRows == currentRowIndex) break; } // Write the closing tag for the table @@ -239,6 +238,7 @@ // Inform the delegate that the export process is complete [delegate performSelectorOnMainThread:@selector(xmlExportProcessComplete:) withObject:self waitUntilDone:NO]; + [xmlExportPool release]; [pool release]; } @catch (NSException *e) { } |