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

Unified Diff: runtime/bin/directory_win.cc

Issue 45833003: Fix directory-listing to return a future on cancel. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix reporting of immediate errors from directory listing. Created 7 years, 2 months 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 | « runtime/bin/directory_macos.cc ('k') | sdk/lib/io/directory_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/directory_win.cc
diff --git a/runtime/bin/directory_win.cc b/runtime/bin/directory_win.cc
index e3e390f4292ac0bd7328ced0f9a65869afe5a457..3733a71384e5d734f7d4b52d1694aba85875238f 100644
--- a/runtime/bin/directory_win.cc
+++ b/runtime/bin/directory_win.cc
@@ -206,14 +206,18 @@ ListType DirectoryListingEntry::Next(DirectoryListing* listing) {
return kListError;
}
- if (FindClose(reinterpret_cast<HANDLE>(lister_)) == 0) {
- return kListError;
- }
-
return kListDone;
}
+DirectoryListingEntry::~DirectoryListingEntry() {
+ ResetLink();
+ if (lister_ != 0) {
+ FindClose(reinterpret_cast<HANDLE>(lister_));
+ }
+}
+
+
void DirectoryListingEntry::ResetLink() {
if (link_ != NULL && (parent_ == NULL || parent_->link_ != link_)) {
delete link_;
« no previous file with comments | « runtime/bin/directory_macos.cc ('k') | sdk/lib/io/directory_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698