[f-spot] Ensure that FileInfo is disposed in RecursiveFileEnumerator
- From: Ruben Vermeersch <rubenv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [f-spot] Ensure that FileInfo is disposed in RecursiveFileEnumerator
- Date: Thu, 20 May 2010 09:16:16 +0000 (UTC)
commit c455c9ad60be0187d1bfced7395f8e6cb5104320
Author: Mike Gemünde <mike gemuende de>
Date: Wed May 19 19:25:39 2010 +0200
Ensure that FileInfo is disposed in RecursiveFileEnumerator
https://bugzilla.gnome.org/show_bug.cgi?id=619174
src/Utils/RecursiveFileEnumerator.cs | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/Utils/RecursiveFileEnumerator.cs b/src/Utils/RecursiveFileEnumerator.cs
index cf2553a..96ce4a9 100644
--- a/src/Utils/RecursiveFileEnumerator.cs
+++ b/src/Utils/RecursiveFileEnumerator.cs
@@ -37,11 +37,13 @@ namespace FSpot.Utils
yield break;
}
- if (root_info.FileType == FileType.Regular) {
- yield return root;
- } else if (root_info.FileType == FileType.Directory) {
- foreach (var child in ScanDirectoryForFiles (root)) {
- yield return child;
+ using (root_info) {
+ if (root_info.FileType == FileType.Regular) {
+ yield return root;
+ } else if (root_info.FileType == FileType.Directory) {
+ foreach (var child in ScanDirectoryForFiles (root)) {
+ yield return child;
+ }
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]