[CSHARP-426] Disposing MongoGridFSStream Created: 02/Apr/12  Updated: 02/Apr/15  Resolved: 04/Apr/12

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.4
Fix Version/s: 1.4.1

Type: Bug Priority: Major - P3
Reporter: Aristarkh Zagorodnikov Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

MongoGridFSStream.Dispose() behaves strangely and (from my point of view) inconsistently:
1. It always tries to update file's MD5 and length, even if file was not changed (and even if stream was opened only for reading)
2. It has the UpdateMD5 property that, when set to false, leads to file's MD5 being updated to null (we actually botched MD5 for all of our files with this, hehe)



 Comments   
Comment by Aristarkh Zagorodnikov [ 05/Apr/12 ]

Thank you very much for the fix.

Comment by Robert Stam [ 04/Apr/12 ]

Added _fileIsDirty flag and only update metadata when file was actually modified

Generated at Wed Feb 07 21:36:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.