aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPCustomQuery.m
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2015-09-10 23:17:29 +0200
committerMax <post@wickenrode.com>2015-09-10 23:17:29 +0200
commitfe050dfb404ccd15d34ef46b27274545d05e9c58 (patch)
tree60cd7cb675b631a5bedf25aca95c8cf7f173510c /Source/SPCustomQuery.m
parent6f00eaa2e639fa852793fe338627e089586463f2 (diff)
downloadsequelpro-fe050dfb404ccd15d34ef46b27274545d05e9c58.tar.gz
sequelpro-fe050dfb404ccd15d34ef46b27274545d05e9c58.tar.bz2
sequelpro-fe050dfb404ccd15d34ef46b27274545d05e9c58.zip
Attempt at fixing a crash when trying to open the field editor sheet and Accessibility Services are enabled and a certain other Application is running (issue #2220)
Diffstat (limited to 'Source/SPCustomQuery.m')
-rw-r--r--Source/SPCustomQuery.m13
1 files changed, 9 insertions, 4 deletions
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m
index 15839a7e..c22e5b59 100644
--- a/Source/SPCustomQuery.m
+++ b/Source/SPCustomQuery.m
@@ -2441,6 +2441,12 @@
// Check if the field can identified bijectively
if ( aTableView == customQueryView ) {
+
+ // Nothing is editable while the field editor is running.
+ // This guards against a special case where accessibility services might
+ // check if a table field is editable while the sheet is running.
+ if (fieldEditor) return NO;
+
NSDictionary *columnDefinition = [cqColumnDefinition objectAtIndex:[[aTableColumn identifier] integerValue]];
// Check if current field is a blob
@@ -2450,7 +2456,6 @@
// Open the editing sheet if required
if ([customQueryView shouldUseFieldEditorForRow:rowIndex column:[[aTableColumn identifier] integerValue] checkWithLock:NULL])
{
- if (fieldEditor) SPClear(fieldEditor);
fieldEditor = [[SPFieldEditorController alloc] init];
// Remember edited row for reselecting and setting the scroll view after reload
@@ -3681,9 +3686,9 @@
}
}
- if(fieldEditor) {
- SPClear(fieldEditor);
- }
+ // this is a delegate method of the field editor controller. calling release
+ // now would risk a dealloc while it is still our parent on the stack:
+ [fieldEditor autorelease], fieldEditor = nil;
// Preserve focus and restore selection indexes if appropriate
[[tableDocumentInstance parentWindow] makeFirstResponder:customQueryView];