summaryrefslogtreecommitdiff
path: root/db/dbcommands.cpp
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2011-05-04 14:17:50 -0400
committerMathias Stearn <mathias@10gen.com>2011-05-04 15:41:43 -0400
commit1577c6e8a2a213d5e5e57dbd195f16c77e98ebf7 (patch)
treee02798d33904c65724a4ca81886b35ac016ed3af /db/dbcommands.cpp
parent59bfa55e659fcf2d05b50290d22ce0e39ccebc9c (diff)
downloadmongo-1577c6e8a2a213d5e5e57dbd195f16c77e98ebf7.tar.gz
don't use scoped_ptr with ClientCursor
Diffstat (limited to 'db/dbcommands.cpp')
-rw-r--r--db/dbcommands.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/db/dbcommands.cpp b/db/dbcommands.cpp
index 30eb068bcca..a7979b0bdf6 100644
--- a/db/dbcommands.cpp
+++ b/db/dbcommands.cpp
@@ -992,7 +992,7 @@ namespace mongo {
BSONObj sort = BSON( "files_id" << 1 << "n" << 1 );
shared_ptr<Cursor> cursor = bestGuessCursor(ns.c_str(), query, sort);
- scoped_ptr<ClientCursor> cc (new ClientCursor(QueryOption_NoCursorTimeout, cursor, ns.c_str()));
+ auto_ptr<ClientCursor> cc (new ClientCursor(QueryOption_NoCursorTimeout, cursor, ns.c_str()));
int n = 0;
while ( cursor->ok() ) {
@@ -1018,17 +1018,19 @@ namespace mongo {
int len;
const char * data = obj["data"].binDataClean( len );
- ClientCursor::YieldLock yield (cc);
+ ClientCursor::YieldLock yield (cc.get());
try {
md5_append( &st , (const md5_byte_t*)(data) , len );
n++;
}
catch (...) {
- yield.relock(); // needed before yield goes out of scope
+ if ( ! yield.stillOk() ) // relocks
+ cc.release();
throw;
}
if ( ! yield.stillOk() ) {
+ cc.release();
uasserted(13281, "File deleted during filemd5 command");
}
}