Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix memory leaks.
  • Loading branch information
stuconnolly committed May 28, 2014
1 parent 8e4e360 commit bc24565
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Source/SPExportInitializer.m
Expand Up @@ -451,11 +451,11 @@ - (void)exportTables:(NSArray *)exportTables orDataArray:(NSArray *)dataArray
if ([problemFiles count] > 0) {
[self errorCreatingExportFileHandles:problemFiles];
}
else {
[problemFiles release];

else {
[self startExport];
}

[problemFiles release];
}

/**
Expand Down
8 changes: 6 additions & 2 deletions Source/SPViewCopy.m
Expand Up @@ -45,14 +45,18 @@ - (BOOL)moveView:(NSString *)view from:(NSString *)sourceDatabase to:(NSString *
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]
Expand Down

0 comments on commit bc24565

Please sign in to comment.