aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-12-04 15:44:51 +0000
committerrowanbeentje <rowan@beent.je>2009-12-04 15:44:51 +0000
commit11eca30d1b8abf87575bb59ef3f1a7e2478ab21a (patch)
treefd3ae5ba66229cea5fce9bd3881715cdc7b79590
parent3a289007e40603f724d27f8ca0824075ad005e79 (diff)
downloadsequelpro-11eca30d1b8abf87575bb59ef3f1a7e2478ab21a.tar.gz
sequelpro-11eca30d1b8abf87575bb59ef3f1a7e2478ab21a.tar.bz2
sequelpro-11eca30d1b8abf87575bb59ef3f1a7e2478ab21a.zip
- Fix saving of files or images added to the SPFieldEditor
- Fix a couple of memory leaks in the SPFieldEditor - Fix a crash caused by attempted reselection of databases after disconnection if no database was selected
-rw-r--r--Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m2
-rw-r--r--Source/SPFieldEditorController.m4
-rw-r--r--Source/TableContent.m7
3 files changed, 6 insertions, 7 deletions
diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m
index 07ea4c39..aa5dc842 100644
--- a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m
+++ b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m
@@ -395,7 +395,7 @@ static BOOL sTruncateLongFieldInLogs = YES;
NSString *currentDatabase = nil;
// Store the currently selected database and encoding so they can be re-set if reconnection was successful
- if (delegate && [delegate respondsToSelector:@selector(onReconnectShouldSelectDatabase:)]) {
+ if (delegate && [delegate respondsToSelector:@selector(onReconnectShouldSelectDatabase:)] && [delegate onReconnectShouldSelectDatabase:self]) {
currentDatabase = [NSString stringWithString:[delegate onReconnectShouldSelectDatabase:self]];
}
diff --git a/Source/SPFieldEditorController.m b/Source/SPFieldEditorController.m
index 4df767f4..ed10dbf1 100644
--- a/Source/SPFieldEditorController.m
+++ b/Source/SPFieldEditorController.m
@@ -103,7 +103,7 @@
[qlTypesItems addObject:type];
}
}
- qlTypes = [NSDictionary dictionaryWithObject:[qlTypesItems retain] forKey:SPQuickLookTypes];
+ qlTypes = [NSDictionary dictionaryWithObject:qlTypesItems forKey:SPQuickLookTypes];
[qlTypesItems release];
}
return self;
@@ -324,7 +324,7 @@
// Remember spell cheecker status
[prefs setBool:[editTextView isContinuousSpellCheckingEnabled] forKey:SPBlobTextEditorSpellCheckingEnabled];
- return ( editSheetReturnCode && isEditable ) ? [sheetEditData retain] : nil;
+ return ( editSheetReturnCode && isEditable ) ? sheetEditData : nil;
}
/*
diff --git a/Source/TableContent.m b/Source/TableContent.m
index 868b0ad1..7fcb284b 100644
--- a/Source/TableContent.m
+++ b/Source/TableContent.m
@@ -218,7 +218,6 @@
// Empty the stored data arrays, including emptying the tableValues array
// by ressignment for thread safety.
- tableRowsCount = 0;
previousTableRowsCount = 0;
[self clearTableValues];
[tableContentView reloadData];
@@ -447,7 +446,6 @@
// Reset the table store if required - basically if the table is being changed,
// reassigning before emptying for thread safety.
if (!previousTableRowsCount) {
- tableRowsCount = 0;
[self clearTableValues];
}
@@ -494,6 +492,7 @@
tableValuesTransition = tableValues;
pthread_mutex_lock(&tableValuesLock);
+ tableRowsCount = 0;
tableValues = [[NSMutableArray alloc] init];
pthread_mutex_unlock(&tableValuesLock);
[tableValuesTransition release];
@@ -1000,7 +999,6 @@
// Reset and reload data using the new filter settings
previousTableRowsCount = 0;
- tableRowsCount = 0;
[self clearTableValues];
[self loadTableValues];
[tableContentView scrollPoint:NSMakePoint(0.0, 0.0)];
@@ -2851,7 +2849,8 @@
currentlyEditingRow = rowIndex;
}
- if ([editData isEqualToString:[prefs objectForKey:SPNullValue]]
+ if ([editData isKindOfClass:[NSString class]]
+ && [editData isEqualToString:[prefs objectForKey:SPNullValue]]
&& [[NSArrayObjectAtIndex(dataColumns, [[aTableColumn identifier] intValue]) objectForKey:@"null"] boolValue])
{
[editData release];