Skip to content

Commit 0236542

Browse files
lapcatrentzsch
authored andcommitted
Fix bugs identified by clang static analyzer.
Signed-off-by: Jonathan 'Wolf' Rentzsch <[email protected]>
1 parent e6d5ef1 commit 0236542

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

Plugin/CTGradient.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ - (void)dealloc
5353
{
5454
CGFunctionRelease(gradientFunction);
5555

56-
CTGradientElement *elementToRemove = elementList;
56+
CTGradientElement *elementToRemove;
5757
while(elementList != nil)
5858
{
5959
elementToRemove = elementList;

Plugin/Plugin.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ - (void) _drawGearIcon
818818
NSColor *startingColor = [NSColor colorWithDeviceWhite:1.0 alpha:1.0];
819819
NSColor *endingColor = [NSColor colorWithDeviceWhite:1.0 alpha:0.0];
820820

821-
[gradient initWithStartingColor:startingColor endingColor:endingColor];
821+
gradient = [gradient initWithStartingColor:startingColor endingColor:endingColor];
822822

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

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

Plugin/SparkleManager.m

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ of this software and associated documentation files (the "Software"), to deal
3030
#import "CTFUserDefaultsController.h"
3131
#import "CTFPreferencesDictionary.h"
3232

33+
#import <objc/runtime.h>
34+
3335
// NSUserDefaults keys
3436
static NSString *sAutomaticallyCheckForUpdates = @"checkForUpdatesOnFirstLoad";
3537

0 commit comments

Comments
 (0)