Skip to content

Commit

Permalink
Fix Cursor Finalizer Exception if connection is closed before.
Browse files Browse the repository at this point in the history
  • Loading branch information
lanwin committed May 17, 2010
1 parent d99660c commit 044a26c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/MongoDB/Cursor_1.cs
Expand Up @@ -258,7 +258,7 @@ public void Dispose()
/// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
protected virtual void Dispose(bool disposing)
{
if(Id == 0) //All server side resources disposed of.
if(Id == 0 || _connection.State != ConnectionState.Opened) //All server side resources disposed of.
return;

KillCursor(Id);
Expand Down

0 comments on commit 044a26c

Please sign in to comment.