aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPExportFileUtilities.m
diff options
context:
space:
mode:
authorAbhi Beckert <abhi@Twist-of-Lemon-2.local>2015-05-16 08:06:06 +1000
committerAbhi Beckert <abhi@Twist-of-Lemon-2.local>2015-05-16 08:06:06 +1000
commit57a6f6c73bdaa202164645370d37fcbe5d14a092 (patch)
treedd30aa6156064f1d4c0e10ea87059625470fc2f9 /Source/SPExportFileUtilities.m
parentb5e972f4504043dfb9c358e272e93fb59ae2127f (diff)
parent0f0c43eb74408b6a65a42e2c6fd46f4142ef8e3f (diff)
downloadsequelpro-57a6f6c73bdaa202164645370d37fcbe5d14a092.tar.gz
sequelpro-57a6f6c73bdaa202164645370d37fcbe5d14a092.tar.bz2
sequelpro-57a6f6c73bdaa202164645370d37fcbe5d14a092.zip
Merge remote-tracking branch 'sequelpro/master'
Diffstat (limited to 'Source/SPExportFileUtilities.m')
-rw-r--r--Source/SPExportFileUtilities.m17
1 files changed, 11 insertions, 6 deletions
diff --git a/Source/SPExportFileUtilities.m b/Source/SPExportFileUtilities.m
index aafea54d..0cecad91 100644
--- a/Source/SPExportFileUtilities.m
+++ b/Source/SPExportFileUtilities.m
@@ -31,10 +31,12 @@
#import "SPExportFileUtilities.h"
#import "SPExportInitializer.h"
#import "SPExporter.h"
-#import "SPAlertSheets.h"
#import "SPExportFile.h"
#import "SPDatabaseDocument.h"
#import "SPCustomQuery.h"
+#import "SPTableContent.h"
+#import "SPTableContentDelegate.h"
+#import "SPExportController+SharedPrivateAPI.h"
#import <SPMySQL/SPMySQL.h>
@@ -47,13 +49,10 @@ typedef enum
SPExportErrorChoice;
@interface SPExportController (SPExportFileUtilitiesPrivateAPI)
-
- (void)_reopenExportSheet;
-- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;
-
@end
-@implementation SPExportController (SPExportFileUtilities)
+@implementation SPExportController (SPExportFileUtilitiesPrivateAPI)
/**
* Writes the CSV file header to the supplied export file.
@@ -115,7 +114,7 @@ SPExportErrorChoice;
if ([exportXMLFormatPopUpButton indexOfSelectedItem] == SPXMLExportMySQLFormat) {
- NSString *tag = @"";
+ NSString *tag;
if (exportSource == SPTableExport) {
tag = [NSString stringWithFormat:@"<mysqldump xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n<database name=\"%@\">\n\n", [tableDocumentInstance database]];
@@ -141,6 +140,11 @@ SPExportErrorChoice;
*/
- (void)errorCreatingExportFileHandles:(NSArray *)files
{
+ // We don't know where "files" came from, but we know 2 things:
+ // - NSAlert will NOT retain it as contextInfo
+ // - This method continues execution after [alert beginSheet:...], thus even if files was retained before, it could be released before the alert ends
+ [files retain];
+
// Get the number of files that already exist as well as couldn't be created because of other reasons
NSUInteger filesAlreadyExisting = 0;
NSUInteger parentFoldersMissing = 0;
@@ -270,6 +274,7 @@ SPExportErrorChoice;
[exportProgressWindow orderOut:self];
[alert beginSheetModalForWindow:[tableDocumentInstance parentWindow] modalDelegate:self didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) contextInfo:files];
+ [alert autorelease];
}
/**