summaryrefslogtreecommitdiff
path: root/src/mongo/db/clientcursor.cpp
diff options
context:
space:
mode:
authorJason Rassi <rassi@10gen.com>2015-01-12 17:24:21 -0500
committerJason Rassi <rassi@10gen.com>2015-01-15 05:41:10 -0500
commit04237a169a4a8824fd6476617e237c5d69c156c7 (patch)
treeeefacf14085cdd7f66ea6a17b6d38c28a2d5eeb5 /src/mongo/db/clientcursor.cpp
parent0aa409c0f7c1d65cf352e729e7b4787cfea20c23 (diff)
downloadmongo-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.cpp5
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