mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 02:25:34 +00:00
Bug 1722777 - Pre: Reuse existing directory iteration function when deleting folder content on Windows. r=nalexander
Depends on D140428 Differential Revision: https://phabricator.services.mozilla.com/D140910
This commit is contained in:
parent
9e17c0d135
commit
38f65972b7
@ -2315,14 +2315,9 @@ nsLocalFile::Remove(bool aRecursive) {
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool more = false;
|
nsCOMPtr<nsIFile> file;
|
||||||
while (NS_SUCCEEDED(dirEnum->HasMoreElements(&more)) && more) {
|
while (NS_SUCCEEDED(dirEnum->GetNextFile(getter_AddRefs(file))) && file) {
|
||||||
nsCOMPtr<nsISupports> item;
|
file->Remove(aRecursive);
|
||||||
dirEnum->GetNext(getter_AddRefs(item));
|
|
||||||
nsCOMPtr<nsIFile> file = do_QueryInterface(item);
|
|
||||||
if (file) {
|
|
||||||
file->Remove(aRecursive);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (RemoveDirectoryW(mWorkingPath.get()) == 0) {
|
if (RemoveDirectoryW(mWorkingPath.get()) == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user