Index: base/file_version_info_mac.mm |
=================================================================== |
--- base/file_version_info_mac.mm (revision 7212) |
+++ base/file_version_info_mac.mm (working copy) |
@@ -9,14 +9,8 @@ |
#include "base/logging.h" |
#include "base/string_util.h" |
-FileVersionInfo::FileVersionInfo(const std::wstring& file_path) { |
- NSString* path = [[NSString alloc] |
- initWithCString:reinterpret_cast<const char*>(file_path.c_str()) |
- encoding:NSUTF32StringEncoding]; |
- bundle_ = [NSBundle bundleWithPath: path]; |
-} |
- |
FileVersionInfo::FileVersionInfo(NSBundle *bundle) : bundle_(bundle) { |
+ [bundle_ retain]; |
Erik does not do reviews
2008/12/19 19:37:05
oops. good catch.
|
} |
FileVersionInfo::~FileVersionInfo() { |
@@ -34,9 +28,19 @@ |
// static |
FileVersionInfo* FileVersionInfo::CreateFileVersionInfo( |
const std::wstring& file_path) { |
- return new FileVersionInfo(file_path); |
+ NSString* path = [NSString stringWithCString: |
+ reinterpret_cast<const char*>(file_path.c_str()) |
+ encoding:NSUTF32StringEncoding]; |
+ return new FileVersionInfo([NSBundle bundleWithPath:path]); |
} |
+// static |
+FileVersionInfo* FileVersionInfo::CreateFileVersionInfo( |
+ const FilePath& file_path) { |
+ NSString* path = [NSString stringWithUTF8String:file_path.value().c_str()]; |
+ return new FileVersionInfo([NSBundle bundleWithPath:path]); |
+} |
+ |
std::wstring FileVersionInfo::company_name() { |
return L""; |
} |