Skip to content
This repository

Removes Static Analyzer Warning #70

Merged
merged 1 commit into from over 1 year ago

2 participants

Raphael Sobik Robbie Hanson
Raphael Sobik

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.

Raphael Sobik 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
Robbie Hanson robbiehanson merged commit a494160 into from
Robbie Hanson robbiehanson closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Nov 08, 2012
Raphael Sobik 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
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 12 additions and 10 deletions. Show diff stats Hide diff stats

  1. 22  Lumberjack/DDAbstractDatabaseLogger.m
22  Lumberjack/DDAbstractDatabaseLogger.m
@@ -220,16 +220,18 @@ - (void)createAndStartDeleteTimer
220 220
 	if ((deleteTimer == NULL) && (deleteInterval > 0.0) && (maxAge > 0.0))
221 221
 	{
222 222
 		deleteTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, loggerQueue);
223  
-		
224  
-		dispatch_source_set_event_handler(deleteTimer, ^{ @autoreleasepool {
225  
-			
226  
-			[self performDelete];
227  
-			
228  
-		}});
229  
-		
230  
-		[self updateDeleteTimer];
231  
-		
232  
-		dispatch_resume(deleteTimer);
  223
+
  224
+        if (deleteTimer != NULL) {
  225
+            dispatch_source_set_event_handler(deleteTimer, ^{ @autoreleasepool {
  226
+
  227
+                [self performDelete];
  228
+
  229
+            }});
  230
+
  231
+            [self updateDeleteTimer];
  232
+            
  233
+            dispatch_resume(deleteTimer);
  234
+        }
233 235
 	}
234 236
 }
235 237
 
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.