Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2222)

Unified Diff: base/file_version_info_mac.mm

Issue 15082: Add FilePath support to FileVersionInfo, fix Mac memory issues. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/file_version_info.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"";
}
« no previous file with comments | « base/file_version_info.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698