Browse Source

if DEBUG is defined, then you'll get a little more info when you've got open result sets out when using the queue.

ccgus 12 years ago
parent
commit
2224f216e7
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/FMDatabaseQueue.m

+ 8 - 0
src/FMDatabaseQueue.m

@@ -133,6 +133,14 @@ - (void)inDatabase:(void (^)(FMDatabase *db))block {
         
         
         if ([db hasOpenResultSets]) {
         if ([db hasOpenResultSets]) {
             NSLog(@"Warning: there is at least one open result set around after performing [FMDatabaseQueue inDatabase:]");
             NSLog(@"Warning: there is at least one open result set around after performing [FMDatabaseQueue inDatabase:]");
+            
+#ifdef DEBUG
+            NSSet *openSetCopy = FMDBReturnAutoreleased([[db valueForKey:@"_openResultSets"] copy]);
+            for (NSValue *rsInWrappedInATastyValueMeal in openSetCopy) {
+                FMResultSet *rs = (FMResultSet *)[rsInWrappedInATastyValueMeal pointerValue];
+                NSLog(@"query: '%@'", [rs query]);
+            }
+#endif
         }
         }
     });
     });