Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Removes Static Analyzer Warning #70

Merged
merged 1 commit into from

2 participants

@rsobik

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.

@rsobik rsobik 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.
9ff30cd
@robbiehanson robbiehanson merged commit a494160 into CocoaLumberjack:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 8, 2012
  1. @rsobik

    Removes Static Analyzer Warning

    rsobik authored
    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.
This page is out of date. Refresh to see the latest.
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);
+ }
}
}
Something went wrong with that request. Please try again.