summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-12-25 17:59:11 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2009-12-25 17:59:11 -0800
commite1245fbd2ec2051392b98a57a8002a4bf3c2c753 (patch)
tree30c00d64f76f7a08a2978c5e3acb0ce0ccdda9bd /src
parent4d690fb9dd48a47d0408b9db4cd1b73124eecdea (diff)
downloadDotNetOpenAuth-e1245fbd2ec2051392b98a57a8002a4bf3c2c753.zip
DotNetOpenAuth-e1245fbd2ec2051392b98a57a8002a4bf3c2c753.tar.gz
DotNetOpenAuth-e1245fbd2ec2051392b98a57a8002a4bf3c2c753.tar.bz2
Fixed bug where unloaded counters were not reset when submitting a report.
Diffstat (limited to 'src')
-rw-r--r--src/DotNetOpenAuth/Reporting.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth/Reporting.cs b/src/DotNetOpenAuth/Reporting.cs
index 7045aed..15af4ba 100644
--- a/src/DotNetOpenAuth/Reporting.cs
+++ b/src/DotNetOpenAuth/Reporting.cs
@@ -347,6 +347,13 @@ namespace DotNetOpenAuth {
counter.Reset();
counter.Flush();
}
+
+ // We can just delete the files for counters that are not currently loaded.
+ foreach (string eventFile in file.GetFileNames("event-*.txt")) {
+ if (!events.Values.Any(e => string.Equals(e.FileName, eventFile, StringComparison.OrdinalIgnoreCase))) {
+ file.DeleteFile(eventFile);
+ }
+ }
}
return true;