Skip to content

Commit

Permalink
Fix bugs identified by clang static analyzer.
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan 'Wolf' Rentzsch <[email protected]>
  • Loading branch information
lapcat authored and rentzsch committed Jul 6, 2009
1 parent e6d5ef1 commit 0236542
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Plugin/CTGradient.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ - (void)dealloc
{
CGFunctionRelease(gradientFunction);

CTGradientElement *elementToRemove = elementList;
CTGradientElement *elementToRemove;
while(elementList != nil)
{
elementToRemove = elementList;
Expand Down
4 changes: 2 additions & 2 deletions Plugin/Plugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ - (void) _drawGearIcon
NSColor *startingColor = [NSColor colorWithDeviceWhite:1.0 alpha:1.0];
NSColor *endingColor = [NSColor colorWithDeviceWhite:1.0 alpha:0.0];

[gradient initWithStartingColor:startingColor endingColor:endingColor];
gradient = [gradient initWithStartingColor:startingColor endingColor:endingColor];

// draw gradient behind gear so that it's visible even on dark backgrounds
[gradient drawFromCenter:gearImageCenter
Expand Down Expand Up @@ -857,7 +857,7 @@ - (void) _drawBackground
id gradient = [NSClassFromString(@"NSGradient") alloc];
if (gradient != nil)
{
[gradient initWithStartingColor:startingColor endingColor:endingColor];
gradient = [gradient initWithStartingColor:startingColor endingColor:endingColor];

[gradient drawInBezierPath:[NSBezierPath bezierPathWithRect:fillRect] angle:90.0 + ((mouseIsDown && mouseInside) ? 0.0 : 180.0)];

Expand Down
2 changes: 2 additions & 0 deletions Plugin/SparkleManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ of this software and associated documentation files (the "Software"), to deal
#import "CTFUserDefaultsController.h"
#import "CTFPreferencesDictionary.h"

#import <objc/runtime.h>

// NSUserDefaults keys
static NSString *sAutomaticallyCheckForUpdates = @"checkForUpdatesOnFirstLoad";

Expand Down

0 comments on commit 0236542

Please sign in to comment.