From 04237a169a4a8824fd6476617e237c5d69c156c7 Mon Sep 17 00:00:00 2001 From: Jason Rassi Date: Mon, 12 Jan 2015 17:24:21 -0500 Subject: SERVER-16607 Agg cursor's pin needs to be cleaned up under coll lock --- src/mongo/db/clientcursor.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mongo/db/clientcursor.cpp') diff --git a/src/mongo/db/clientcursor.cpp b/src/mongo/db/clientcursor.cpp index ffa40cab530..bc09cc4bc01 100644 --- a/src/mongo/db/clientcursor.cpp +++ b/src/mongo/db/clientcursor.cpp @@ -226,7 +226,7 @@ namespace mongo { ClientCursorPin::~ClientCursorPin() { cursorStatsOpenPinned.decrement(); - DESTRUCTOR_GUARD( release(); ); + release(); } void ClientCursorPin::release() { @@ -244,9 +244,12 @@ namespace mongo { // Unpin the cursor under the collection cursor manager lock. _cursor->cursorManager()->unpin( _cursor ); } + + _cursor = NULL; } void ClientCursorPin::deleteUnderlying() { + invariant( _cursor ); invariant( _cursor->isPinned() ); // Note the following subtleties of this method's implementation: // - We must unpin the cursor before destruction, since it is an error to destroy a pinned -- cgit v1.2.1