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:
parent
33ac3c31c3
commit
1e1977a698
@ -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(){
|
||||
|
Loading…
Reference in New Issue
Block a user