Fix some leaks and an uninitialized variable, based on warnings from the clang analyzer.

This commit is contained in:
Matt Palcic
2014-01-29 15:50:41 -05:00
parent 577c40c9a8
commit 5ffd537ef0
3 changed files with 13 additions and 1 deletions
@@ -406,7 +406,7 @@
}
//Draw the path
CGRect rect;
CGRect rect = CGRectZero;
if (_progressDirection == M13ProgressViewBorderedBarProgressDirectionLeftToRight) {
rect = CGRectMake(_borderWidth * 2, _borderWidth * 2, (self.bounds.size.width - (4 * _borderWidth)) * self.progress, self.bounds.size.height - (4 * _borderWidth));
} else if (_progressDirection == M13ProgressViewBorderedBarProgressDirectionRightToLeft) {
@@ -353,6 +353,8 @@
}
//Set the paths to the layer
_progressLayer.path = pathRef;
CGPathRelease(pathRef);
}
- (void)drawBackground
@@ -420,6 +422,8 @@
}
//Set the paths to the layer
_backgroundLayer.path = pathRef;
CGPathRelease(pathRef);
}
- (void)drawIndeterminate
@@ -496,6 +500,10 @@
//Set the paths to the layer
_progressLayer.path = progressPathRef;
_backgroundLayer.path = backgroundPathRef;
CGPathRelease(progressPathRef);
CGPathRelease(backgroundPathRef);
//increase the index by one for movement
indeterminateIndex += 1;
if (indeterminateIndex == numberOfSegmentsToBeColored + _numberOfSegments) {
@@ -533,6 +533,8 @@
//Set the path
_backgroundLayer.path = pathRef;
CGPathRelease(pathRef);
}
- (void)drawProgress
@@ -572,6 +574,8 @@
//Set the path
_progressLayer.path = pathRef;
CGPathRelease(pathRef);
//Update label
_percentageLabel.text = [_percentageFormatter stringFromNumber:[NSNumber numberWithFloat:self.progress]];
}