From ad7da68f84f6cfd038d45c4469f0a4fcb5373ea4 Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Wed, 2 Sep 2009 00:29:14 +0200 Subject: [PATCH] Fix some Xcode static analyzer warnings The only relevant complaint was a memory leak when opening files from Finder. --- src/MacVim/MMAppController.m | 2 +- src/MacVim/MMPreferenceController.m | 2 +- src/MacVim/MMTextView.m | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/MacVim/MMAppController.m b/src/MacVim/MMAppController.m index a61856587a..63218c1c40 100644 --- a/src/MacVim/MMAppController.m +++ b/src/MacVim/MMAppController.m @@ -1560,7 +1560,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef, if (openFiles != nil) *openFiles = dict; - return files; + return [files autorelease]; } #if MM_HANDLE_XCODE_MOD_EVENT diff --git a/src/MacVim/MMPreferenceController.m b/src/MacVim/MMPreferenceController.m index 54910632e8..a50184bcec 100644 --- a/src/MacVim/MMPreferenceController.m +++ b/src/MacVim/MMPreferenceController.m @@ -227,7 +227,7 @@ NSString *kOdbEditorIdentifierWriteRoom = @"com.hogbaysoftware.WriteRoom"; // user changes settings in terminal, the changes are reflected in the // dialog) - NSString *versionString; + NSString *versionString = @""; // Check if ODB path exists before calling isFilePackageAtPath: otherwise // an error is output to stderr on Tiger. diff --git a/src/MacVim/MMTextView.m b/src/MacVim/MMTextView.m index cf2983da44..490f8bc908 100644 --- a/src/MacVim/MMTextView.m +++ b/src/MacVim/MMTextView.m @@ -937,7 +937,7 @@ numColumns:ncols]; [self setNeedsDisplayInRect:invertRects[n]]; } else { - n = numInvertRects = 0; + numInvertRects = 0; } } else { // The result should look normal; all we need to do is to mark