diff --git a/Builds/VisualStudio2013/RippleD.vcxproj b/Builds/VisualStudio2013/RippleD.vcxproj index 736b4bbac..d8234da41 100644 --- a/Builds/VisualStudio2013/RippleD.vcxproj +++ b/Builds/VisualStudio2013/RippleD.vcxproj @@ -22,19 +22,7 @@ - - true - true - true - true - - - true - true - true - true - - + true true true @@ -1430,12 +1418,24 @@ true true + + true + true + true + true + true true true true + + true + true + true + true + true true @@ -2207,10 +2207,7 @@ - - - - + @@ -2458,7 +2455,6 @@ - @@ -2468,7 +2464,6 @@ - @@ -2533,7 +2528,10 @@ + + + diff --git a/Builds/VisualStudio2013/RippleD.vcxproj.filters b/Builds/VisualStudio2013/RippleD.vcxproj.filters index 3717bcd54..1652be3f4 100644 --- a/Builds/VisualStudio2013/RippleD.vcxproj.filters +++ b/Builds/VisualStudio2013/RippleD.vcxproj.filters @@ -292,8 +292,11 @@ {b99052d6-a903-4dfd-9c68-ff767a7d8f63} - - {c9eed7bc-87ac-4a4f-ab79-91de2319d22a} + + {e2a53cb6-0594-4646-a36f-68d598972da4} + + + {24383350-1f23-42f8-8b58-399fee670b17} @@ -1440,14 +1443,14 @@ [2] Old Ripple\ripple_app\ledger - - [1] Ripple\common\impl + + [1] Ripple\common\functional\impl - - [1] Ripple\common\impl + + [2] Old Ripple\ripple_basics\containers - - [1] Ripple\common\impl + + [2] Old Ripple\ripple_basics\containers @@ -2940,23 +2943,17 @@ [2] Old Ripple\ripple_app\paths - - [1] Ripple\common + + [1] Ripple\common\functional - - [1] Ripple\common + + [2] Old Ripple\ripple_basics\containers - - [1] Ripple\common + + [2] Old Ripple\ripple_basics\containers - - [1] Ripple\common - - - [2] Old Ripple\ripple_app\main - - - [2] Old Ripple\ripple_app\main + + [2] Old Ripple\ripple_basics\containers diff --git a/src/ripple_app/main/Application.cpp b/src/ripple_app/main/Application.cpp index 7626233e6..7a62a208e 100644 --- a/src/ripple_app/main/Application.cpp +++ b/src/ripple_app/main/Application.cpp @@ -56,9 +56,38 @@ template <> char const* LogPartition::getPartitionName () { ret // //------------------------------------------------------------------------------ +// This hack lets the s_instance variable remain set during +// the call to ~Application +class ApplicationImpBase : public Application +{ +public: + ApplicationImpBase () + { + assert (s_instance == nullptr); + s_instance = this; + } + + ~ApplicationImpBase () + { + s_instance = nullptr; + } + + static Application* s_instance; + + static Application& getInstance () + { + bassert (s_instance != nullptr); + return *s_instance; + } +}; + +Application* ApplicationImpBase::s_instance; + +//------------------------------------------------------------------------------ + // VFALCO TODO Move the function definitions into the class declaration class ApplicationImp - : public Application + : public ApplicationImpBase , public RootStoppable , public DeadlineTimer::Listener , public LeakChecked @@ -127,14 +156,6 @@ public: io_latency_probe m_probe; - static ApplicationImp* s_instance; - - static Application& getInstance () - { - bassert (s_instance != nullptr); - return *s_instance; - } - //-------------------------------------------------------------------------- class sample_io_service_latency @@ -298,19 +319,12 @@ public: // VFALCO HACK m_nodeStoreScheduler.setJobQueue (*m_jobQueue); - bassert (s_instance == nullptr); - s_instance = this; - add (m_ledgerMaster->getPropertySource ()); // VFALCO TODO remove these once the call is thread safe. HashMaps::getInstance ().initializeNonce (); } - ~ApplicationImp () - { - } - //-------------------------------------------------------------------------- CollectorManager& getCollectorManager () @@ -1366,10 +1380,6 @@ void ApplicationImp::onAnnounceAddress () //------------------------------------------------------------------------------ -ApplicationImp* ApplicationImp::s_instance; - -//------------------------------------------------------------------------------ - Application::Application () : PropertyStream::Source ("app") { @@ -1382,7 +1392,7 @@ std::unique_ptr make_Application () Application& getApp () { - return ApplicationImp::getInstance (); + return ApplicationImpBase::getInstance (); } // class LoandObject (5removed, use git history to recover)