diff options
author | rowanbeentje <rowan@beent.je> | 2011-02-15 01:24:56 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2011-02-15 01:24:56 +0000 |
commit | 6aa6d20436a1e920151d86c086c64466173aa130 (patch) | |
tree | cddc1ae9176880737ffd4ef2d34dbd9cc14080ef | |
parent | afad99c5e049e30cbe1ac3e9c4dfce7de28501a1 (diff) | |
download | sequelpro-6aa6d20436a1e920151d86c086c64466173aa130.tar.gz sequelpro-6aa6d20436a1e920151d86c086c64466173aa130.tar.bz2 sequelpro-6aa6d20436a1e920151d86c086c64466173aa130.zip |
- When loading tables, ensure that the column count is updated before table timers are set up. This prevents accesses of SPTableStorages while column change realloc/dealloc processes are still running, fixing exceptions on large tables
-rw-r--r-- | Source/SPCustomQuery.m | 7 | ||||
-rw-r--r-- | Source/SPTableContent.m | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index b2859010..c43df1cd 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -882,12 +882,13 @@ [resultData removeAllRows]; pthread_mutex_unlock(&resultDataLock); + // Set the column count on the data store before setting up anything else - + // ensures that SPDataStorage is set up for timer-driven data loads + [resultData setColumnCount:[theResult numOfFields]]; + // Set up the table updates timer [[self onMainThread] initQueryLoadTimer]; - // Set the column count on the data store - [resultData setColumnCount:[theResult numOfFields]]; - // Set up an autorelease pool for row processing dataLoadingPool = [[NSAutoreleasePool alloc] init]; diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index a513ea15..a0b184dd 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -805,12 +805,13 @@ BOOL *columnBlobStatuses = malloc(dataColumnsCount * sizeof(BOOL)); tableLoadTargetRowCount = targetRowCount; + // Set the column count on the data store before setting up anything else - + // ensures that SPDataStorage is set up for timer-driven data loads + [tableValues setColumnCount:dataColumnsCount]; + // Set up the table updates timer [[self onMainThread] initTableLoadTimer]; - // Set the column count on the data store - [tableValues setColumnCount:dataColumnsCount]; - NSAutoreleasePool *dataLoadingPool; NSProgressIndicator *dataLoadingIndicator = [tableDocumentInstance valueForKey:@"queryProgressBar"]; BOOL prefsLoadBlobsAsNeeded = [prefs boolForKey:SPLoadBlobsAsNeeded]; |