summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp
diff options
context:
space:
mode:
authorKyle Suarez <ksuarz@gmail.com>2016-02-10 13:44:10 -0500
committerKyle Suarez <kyle.suarez@mongodb.com>2016-02-10 15:33:17 -0500
commitcfac7b582eaa5539dc05590ec5d974d732d404d2 (patch)
tree417dd4c4bd734e8ac56372da77a1ea9f08f030fa /src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp
parente9a856d0fe34c7cd1087dacd334f142cd7e62308 (diff)
downloadmongo-cfac7b582eaa5539dc05590ec5d974d732d404d2.tar.gz
SERVER-21526 use RAII type for WTSessionCache::getSession
WiredTigerSessionCache::getSession() returns unique pointers to WiredTigerSessions rather than bare pointers. These pointers will automatically call releaseSession() on scope exit. ON_BLOCK_EXIT and other cleanup code has been removed.
Diffstat (limited to 'src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp')
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp
index bd522ebf4bc..4cebed3eb61 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp
@@ -441,7 +441,6 @@ public:
~BulkBuilder() {
_cursor->close(_cursor);
- WiredTigerRecoveryUnit::get(_txn)->getSessionCache()->releaseSession(_session);
}
protected:
@@ -468,7 +467,7 @@ protected:
const Ordering _ordering;
OperationContext* const _txn;
- WiredTigerSession* const _session;
+ UniqueWiredTigerSession const _session;
WT_CURSOR* const _cursor;
};