Bug 903788 - Fix a few memory leaks in Cocoa file picker code. r=smichaud

This commit is contained in:
Josh Aas 2013-08-12 13:29:00 -04:00
Родитель 67a23929df
Коммит 1775fc7148
3 изменённых файлов: 4 добавлений и 10 удалений

Просмотреть файл

@ -26,8 +26,6 @@
#define MAC_OS_X_VERSION_MASK 0x0000FFFF
#define MAC_OS_X_VERSION_MAJOR_MASK 0x0000FFF0
#define MAC_OS_X_VERSION_10_4_HEX 0x00001040 // Not supported
#define MAC_OS_X_VERSION_10_5_HEX 0x00001050
#define MAC_OS_X_VERSION_10_6_HEX 0x00001060
#define MAC_OS_X_VERSION_10_7_HEX 0x00001070
#define MAC_OS_X_VERSION_10_8_HEX 0x00001080
@ -47,8 +45,6 @@ static OperatingSystem
OSXVersionToOperatingSystem(uint32_t aOSXVersion)
{
switch (aOSXVersion & MAC_OS_X_VERSION_MAJOR_MASK) {
case MAC_OS_X_VERSION_10_5_HEX:
return DRIVER_OS_OS_X_10_5;
case MAC_OS_X_VERSION_10_6_HEX:
return DRIVER_OS_OS_X_10_6;
case MAC_OS_X_VERSION_10_7_HEX:

Просмотреть файл

@ -3,9 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#define MAC_OS_X_VERSION_MASK 0x0000FFFF // Not supported
#define MAC_OS_X_VERSION_10_4_HEX 0x00001040 // Not supported
#define MAC_OS_X_VERSION_10_5_HEX 0x00001050
#define MAC_OS_X_VERSION_MASK 0x0000FFFF
#define MAC_OS_X_VERSION_10_6_HEX 0x00001060
#define MAC_OS_X_VERSION_10_7_HEX 0x00001070
#define MAC_OS_X_VERSION_10_8_HEX 0x00001080

Просмотреть файл

@ -321,7 +321,7 @@ nsFilePicker::GetLocalFiles(const nsString& inTitle, bool inAllowMultiple, nsCOM
}
if (theDir) {
[thePanel setDirectoryURL:[[NSURL alloc] initFileURLWithPath:theDir isDirectory:YES]];
[thePanel setDirectoryURL:[NSURL fileURLWithPath:theDir isDirectory:YES]];
}
int result;
@ -414,7 +414,7 @@ nsFilePicker::GetLocalFolder(const nsString& inTitle, nsIFile** outFile)
// set up default directory
NSString *theDir = PanelDefaultDirectory();
if (theDir) {
[thePanel setDirectoryURL:[[NSURL alloc] initFileURLWithPath:theDir isDirectory:YES]];
[thePanel setDirectoryURL:[NSURL fileURLWithPath:theDir isDirectory:YES]];
}
nsCocoaUtils::PrepareForNativeAppModalDialog();
int result = [thePanel runModal];
@ -465,7 +465,7 @@ nsFilePicker::PutLocalFile(const nsString& inTitle, const nsString& inDefaultNam
// set up default directory
NSString *theDir = PanelDefaultDirectory();
if (theDir) {
[thePanel setDirectoryURL:[[NSURL alloc] initFileURLWithPath:theDir isDirectory:YES]];
[thePanel setDirectoryURL:[NSURL fileURLWithPath:theDir isDirectory:YES]];
}
// load the panel