diff options
author | Jason Rassi <rassi@10gen.com> | 2015-01-12 17:24:21 -0500 |
---|---|---|
committer | Jason Rassi <rassi@10gen.com> | 2015-01-15 05:41:10 -0500 |
commit | 04237a169a4a8824fd6476617e237c5d69c156c7 (patch) | |
tree | eefacf14085cdd7f66ea6a17b6d38c28a2d5eeb5 /src/mongo/db/clientcursor.cpp | |
parent | 0aa409c0f7c1d65cf352e729e7b4787cfea20c23 (diff) | |
download | mongo-04237a169a4a8824fd6476617e237c5d69c156c7.tar.gz |
SERVER-16607 Agg cursor's pin needs to be cleaned up under coll lock
Diffstat (limited to 'src/mongo/db/clientcursor.cpp')
-rw-r--r-- | src/mongo/db/clientcursor.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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 |