Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removes Static Analyzer Warning

The function dispatch_source_create can return NULL and clang's static analyzer complains about this.

The code is moved inside a if-branch to execute it only when deleteTimer is not NULL.
  • Loading branch information...
commit 9ff30cd6ac14e21a8552d9780e3556484d7e9a12 1 parent 6c978fd
@rsobik rsobik authored
Showing with 12 additions and 10 deletions.
  1. +12 −10 Lumberjack/DDAbstractDatabaseLogger.m
View
22 Lumberjack/DDAbstractDatabaseLogger.m
@@ -220,16 +220,18 @@ - (void)createAndStartDeleteTimer
if ((deleteTimer == NULL) && (deleteInterval > 0.0) && (maxAge > 0.0))
{
deleteTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, loggerQueue);
-
- dispatch_source_set_event_handler(deleteTimer, ^{ @autoreleasepool {
-
- [self performDelete];
-
- }});
-
- [self updateDeleteTimer];
-
- dispatch_resume(deleteTimer);
+
+ if (deleteTimer != NULL) {
+ dispatch_source_set_event_handler(deleteTimer, ^{ @autoreleasepool {
+
+ [self performDelete];
+
+ }});
+
+ [self updateDeleteTimer];
+
+ dispatch_resume(deleteTimer);
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.