File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -185,8 +185,10 @@ namespace mongo {
185185 }
186186
187187 RecoveryJob::~RecoveryJob () {
188- if ( !_mmfs.empty () )
189- close ();
188+ DESTRUCTOR_GUARD (
189+ if ( !_mmfs.empty () )
190+ close ();
191+ )
190192 }
191193
192194 void RecoveryJob::close () {
@@ -444,8 +446,8 @@ namespace mongo {
444446 }
445447 } brunittest;
446448
447-
448- RecoveryJob RecoveryJob::_instance;
449+ // can't free at termination because order of destruction of global vars is arbitrary
450+ RecoveryJob & RecoveryJob::_instance = *( new RecoveryJob()) ;
449451
450452 } // namespace dur
451453
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ namespace mongo {
3939
4040 bool _recovering; // are we in recovery or WRITETODATAFILES
4141
42- static RecoveryJob _instance;
42+ static RecoveryJob & _instance;
4343 };
4444 }
4545}
You can’t perform that action at this time.
0 commit comments