0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 17:10:48 +01:00

fix concurrency issue cleaning up pooled scopes

This commit is contained in:
Eliot Horowitz 2009-08-21 16:15:36 -04:00
parent 33ac3c31c3
commit 1e1977a698

View File

@ -124,9 +124,15 @@ namespace mongo {
PooledScope( const string pool , Scope * real ) : _pool( pool ) , _real( real ){};
virtual ~PooledScope(){
ScopeCache * sc = scopeCache.get();
assert( sc );
sc->done( _pool , _real );
_real = 0;
if ( sc ){
sc->done( _pool , _real );
_real = 0;
}
else {
log() << "warning: scopeCache is empty!" << endl;
delete _real;
_real = 0;
}
}
void reset(){