aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStuart Connolly <stuart02@gmail.com>2014-05-28 19:02:03 +0100
committerStuart Connolly <stuart02@gmail.com>2014-05-28 19:02:03 +0100
commitbc2456524497b02794402bb1d3be9ba9bd4f1ae9 (patch)
tree3595d64999388bfb4277dad871ec9954de8307ef
parent8e4e360e741c8ae70947531c37ce4d4bfec55ae9 (diff)
downloadsequelpro-bc2456524497b02794402bb1d3be9ba9bd4f1ae9.tar.gz
sequelpro-bc2456524497b02794402bb1d3be9ba9bd4f1ae9.tar.bz2
sequelpro-bc2456524497b02794402bb1d3be9ba9bd4f1ae9.zip
Fix memory leaks.
-rw-r--r--Source/SPExportInitializer.m6
-rw-r--r--Source/SPViewCopy.m8
2 files changed, 9 insertions, 5 deletions
diff --git a/Source/SPExportInitializer.m b/Source/SPExportInitializer.m
index 0d6d718a..bb59dd60 100644
--- a/Source/SPExportInitializer.m
+++ b/Source/SPExportInitializer.m
@@ -451,11 +451,11 @@
if ([problemFiles count] > 0) {
[self errorCreatingExportFileHandles:problemFiles];
}
- else {
- [problemFiles release];
-
+ else {
[self startExport];
}
+
+ [problemFiles release];
}
/**
diff --git a/Source/SPViewCopy.m b/Source/SPViewCopy.m
index 3a708696..5d69494c 100644
--- a/Source/SPViewCopy.m
+++ b/Source/SPViewCopy.m
@@ -45,14 +45,18 @@
NSMutableString *createStatement = [[NSMutableString alloc] initWithString:[self _createViewStatementFor:view inDatabase:sourceDatabase]];
NSString *search = [NSString stringWithFormat:@"VIEW %@", [view backtickQuotedString]];
-
+
NSRange range = [createStatement rangeOfString:search];
if (range.location != NSNotFound) {
NSUInteger replaced = [createStatement replaceOccurrencesOfString:search withString:[NSString stringWithFormat:@"VIEW %@.%@", [targetDatabase backtickQuotedString], [view backtickQuotedString]] options:0 range:range];
- if (replaced != 1) return NO;
+ if (replaced != 1) {
+ [createStatement release];
+
+ return NO;
+ }
// Replace all occurrences of the old database name
[createStatement replaceOccurrencesOfString:[sourceDatabase backtickQuotedString]