From 044a26c0a7181fcc7d9c7ca987da9e4aa53fcf59 Mon Sep 17 00:00:00 2001 From: Steve Wagner Date: Mon, 17 May 2010 19:46:15 +0200 Subject: [PATCH] Fix Cursor Finalizer Exception if connection is closed before. --- source/MongoDB/Cursor_1.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/MongoDB/Cursor_1.cs b/source/MongoDB/Cursor_1.cs index 1781e4cb..32b628f5 100644 --- a/source/MongoDB/Cursor_1.cs +++ b/source/MongoDB/Cursor_1.cs @@ -258,7 +258,7 @@ public void Dispose() /// true to release both managed and unmanaged resources; false to release only unmanaged resources. 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);