diff options
author | Dwight <dmerriman@gmail.com> | 2009-11-18 14:22:00 -0500 |
---|---|---|
committer | Dwight <dmerriman@gmail.com> | 2009-11-18 14:22:00 -0500 |
commit | 560185f6f14cfe3c8379fa5b5d3400ef5178f759 (patch) | |
tree | fd4dd8e957e8d6fa20a12e9fbc238a0ef81277b7 | |
parent | 32fed6a14a26619e038d30d23e997513e4bea595 (diff) | |
download | mongo-560185f6f14cfe3c8379fa5b5d3400ef5178f759.tar.gz |
fix seg fault on windows because of static initializier order
-rw-r--r-- | db/db.vcproj | 2 | ||||
-rw-r--r-- | db/lasterror.h | 1 | ||||
-rw-r--r-- | db/module.cpp | 14 | ||||
-rw-r--r-- | db/module.h | 3 | ||||
-rw-r--r-- | dbtests/test.vcproj | 4 |
5 files changed, 10 insertions, 14 deletions
diff --git a/db/db.vcproj b/db/db.vcproj index 8fc40008dbd..9700d9ac374 100644 --- a/db/db.vcproj +++ b/db/db.vcproj @@ -1567,7 +1567,7 @@ >
</File>
<File
- RelativePath=".\mms.cpp"
+ RelativePath=".\modules\mms.cpp"
>
</File>
<File
diff --git a/db/lasterror.h b/db/lasterror.h index 3c071ccc596..30eaa49f503 100644 --- a/db/lasterror.h +++ b/db/lasterror.h @@ -28,6 +28,7 @@ namespace mongo { struct LastError { string msg; enum UpdatedExistingType { NotUpdate, True, False } updatedExisting; + /* todo: nObjects should be 64 bit */ int nObjects; int nPrev; bool valid; diff --git a/db/module.cpp b/db/module.cpp index 4ebbe8fab79..c19928ffe08 100644 --- a/db/module.cpp +++ b/db/module.cpp @@ -5,26 +5,26 @@ namespace mongo { - std::list<Module*> * Module::ALL = 0; + std::list<Module*> Module::_all; Module::Module( const string& name ) : _name( name ) , _options( (string)"Module " + name + " options" ){ - if ( ! ALL ) - ALL = new list<Module*>(); - ALL->push_back( this ); +// if ( ! allModules ) +// allModules = new list<Module*>(); + _all.push_back( this ); } Module::~Module(){} void Module::addOptions( program_options::options_description& options ){ - for ( list<Module*>::iterator i=ALL->begin(); i!=ALL->end(); i++ ){ + for ( list<Module*>::iterator i=_all.begin(); i!=_all.end(); i++ ){ Module* m = *i; options.add( m->_options ); } } void Module::configAll( program_options::variables_map& params ){ - for ( list<Module*>::iterator i=ALL->begin(); i!=ALL->end(); i++ ){ + for ( list<Module*>::iterator i=_all.begin(); i!=_all.end(); i++ ){ Module* m = *i; m->config( params ); } @@ -33,7 +33,7 @@ namespace mongo { void Module::initAll(){ - for ( list<Module*>::iterator i=ALL->begin(); i!=ALL->end(); i++ ){ + for ( list<Module*>::iterator i=_all.begin(); i!=_all.end(); i++ ){ Module* m = *i; m->init(); } diff --git a/db/module.h b/db/module.h index 9d45762fc9a..909d856e2f3 100644 --- a/db/module.h +++ b/db/module.h @@ -62,9 +62,8 @@ namespace mongo { static void configAll( program_options::variables_map& params ); static void initAll(); - static std::list<Module*> * ALL; - private: + static std::list<Module*> _all; string _name; program_options::options_description _options; }; diff --git a/dbtests/test.vcproj b/dbtests/test.vcproj index a8be20a2477..4e24775cf3b 100644 --- a/dbtests/test.vcproj +++ b/dbtests/test.vcproj @@ -1543,10 +1543,6 @@ >
</File>
<File
- RelativePath="..\db\mms.cpp"
- >
- </File>
- <File
RelativePath="..\db\namespace.cpp"
>
</File>
|