Method TryIncRef
TryIncRef()
Expert: increments the RefCount of this IndexReader
instance only if the IndexReader has not been disposed yet
and returns true
iff the RefCount was
successfully incremented, otherwise false
.
If this method returns false
the reader is either
already disposed or is currently being disposed. Either way this
reader instance shouldn't be used by an application unless
true
is returned.
RefCounts are used to determine when a reader can be disposed safely, i.e. as soon as there are no more references. Be sure to always call a corresponding DecRef(), in a finally clause; otherwise the reader may never be disposed. Note that Dispose(Boolean) simply calls DecRef(), which means that the IndexReader will not really be disposed until DecRef() has been called for all outstanding references.
Declaration
public bool TryIncRef()
Returns
Type | Description |
---|---|
System.Boolean |