From c063b940bbe519c9c495f6e3df3ca4d8ab2aaabe Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Mon, 9 Sep 2013 13:42:49 -0700 Subject: [PATCH] Add RIPPLE_APPLICATION_CLEAN_EXIT option to BeastConfig.h --- BeastConfig.h | 6 ++++++ modules/ripple_app/main/ripple_Application.cpp | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/BeastConfig.h b/BeastConfig.h index 90cbc78645..dd2abedbf9 100644 --- a/BeastConfig.h +++ b/BeastConfig.h @@ -164,4 +164,10 @@ #define RIPPLE_USE_NEW_VALIDATORS 0 #endif +// Turning this on makes the Application object get destroyed, +// which is part of an attempt to have a "clean exit." +#ifndef RIPPLE_APPLICATION_CLEAN_EXIT +#define RIPPLE_APPLICATION_CLEAN_EXIT 0 +#endif + #endif diff --git a/modules/ripple_app/main/ripple_Application.cpp b/modules/ripple_app/main/ripple_Application.cpp index d1a0679b50..6b42c2dbe5 100644 --- a/modules/ripple_app/main/ripple_Application.cpp +++ b/modules/ripple_app/main/ripple_Application.cpp @@ -141,7 +141,7 @@ public: // VFALCO NOTE Change this to control whether or not the Application // object is destroyed on exit // - #if 1 + #if RIPPLE_APPLICATION_CLEAN_EXIT // Application object will be deleted on exit. If the code doesn't exit // cleanly this could cause hangs or crashes on exit. // @@ -149,9 +149,8 @@ public: #else // This will make it so that the Application object is not deleted on exit. // - : SharedSingleton (SingletonLifetime::neverDestroyed) + : SharedSingleton (SingletonLifetime::neverDestroyed) #endif - , mMasterLock (this, "MasterLock", __FILE__, __LINE__) , m_mainService ("io", (getConfig ().NODE_SIZE >= 2) ? 2 : 1, (getConfig ().NODE_SIZE >= 2) ? 1 : 0)