Bug in FileCache

Jun 19, 2012 at 4:10 PM

If a non zero cacheExpireTime TimeSpan is specified then this will cause the Exists method to return false on tiles that have expired. This should mean that the tile can be replaced in the cache with a new one when Add is called. However, the Exists method never deletes expired tile files. When WriteToFile is called it will fail (and throw an IOException) to create the new file because it already exists. The result is missing tiles.

Solution

Simple. Change FileMode.CreateNew to FileMode.Create in the WriteToFile method.

Coordinator
Jun 19, 2012 at 5:49 PM
Edited Jun 19, 2012 at 5:50 PM

Thanks for the report. In fact this bug was already reported by petlot and it is now fixed as you suggested in the repo but not in the release yet.

http://brutile.codeplex.com/workitem/4187