摘自 C# 驱动程序:
It is important that a cursor cleanly release any resources it holds. The key to guaranteeing this is to make sure the Dispose method of the enumerator is called. The foreach statement and the LINQ extension methods all guarantee that Dispose will be called. Only if you enumerate the cursor manually are you responsible for calling Dispose.
通过调用创建的游标“res”:
var res = images.Find(query).SetFields(fb).SetLimit(1);
没有Dispose
方法。我该如何处理它?