Эх сурвалжийг харах

The setting to crash on errors actually crashes now (by way of calling abort), instead of throwing an exception.

August Mueller 14 жил өмнө
parent
commit
dc359ce0de
1 өөрчлөгдсөн 4 нэмэгдсэн , 0 устгасан
  1. 4 0
      src/FMDatabase.m

+ 4 - 0
src/FMDatabase.m

@@ -247,6 +247,7 @@ - (void)warnInUse {
     
 #ifndef NS_BLOCK_ASSERTIONS
     if (_crashOnErrors) {
+        abort();
         NSAssert1(false, @"The FMDatabase %@ is currently in use.", self);
     }
 #endif
@@ -260,6 +261,7 @@ - (BOOL)databaseExists {
         
     #ifndef NS_BLOCK_ASSERTIONS
         if (_crashOnErrors) {
+            abort();
             NSAssert1(false, @"The FMDatabase %@ is not open.", self);
         }
     #endif
@@ -531,6 +533,7 @@ - (FMResultSet *)executeQuery:(NSString *)sql withArgumentsInArray:(NSArray*)arr
                     NSLog(@"DB Query: %@", sql);
 #ifndef NS_BLOCK_ASSERTIONS
                     if (_crashOnErrors) {
+                        abort();
                         NSAssert2(false, @"DB Error: %d \"%@\"", [self lastErrorCode], [self lastErrorMessage]);
                     }
 #endif
@@ -715,6 +718,7 @@ - (BOOL)executeUpdate:(NSString*)sql error:(NSError**)outErr withArgumentsInArra
                     NSLog(@"DB Query: %@", sql);
 #ifndef NS_BLOCK_ASSERTIONS
                     if (_crashOnErrors) {
+                        abort();
                         NSAssert2(false, @"DB Error: %d \"%@\"", [self lastErrorCode], [self lastErrorMessage]);
                     }
 #endif