mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Call protobuff::Shutdown to free dynamic data
This commit is contained in:
@@ -220,36 +220,6 @@ int RippleMain::run (int argc, char const* const* argv)
|
||||
{
|
||||
FatalErrorReporter reporter;
|
||||
|
||||
//
|
||||
// These debug heap calls do nothing in release or non Visual Studio builds.
|
||||
//
|
||||
|
||||
// Checks the heap at every allocation and deallocation (slow).
|
||||
//
|
||||
//Debug::setAlwaysCheckHeap (false);
|
||||
|
||||
// Keeps freed memory blocks and fills them with a guard value.
|
||||
//
|
||||
//Debug::setHeapDelayedFree (false);
|
||||
|
||||
// At exit, reports all memory blocks which have not been freed.
|
||||
//
|
||||
#if RIPPLE_DUMP_LEAKS_ON_EXIT
|
||||
Debug::setHeapReportLeaks (true);
|
||||
#else
|
||||
Debug::setHeapReportLeaks (false);
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
// This is some temporary leak checking test code
|
||||
Debug::setHeapReportLeaks (false);
|
||||
//malloc (512); // Any leaks before this line in the output are from static initializations.
|
||||
ThreadWithCallQueue t ("test");
|
||||
GlobalPagedFreeStore::getInstance ();
|
||||
t.start ();
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
|
||||
setCallingThreadName ("main");
|
||||
@@ -474,3 +444,5 @@ int RippleMain::run (int argc, char const* const* argv)
|
||||
|
||||
return iResult;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -70,10 +70,46 @@ namespace ripple
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
struct ProtobufLibrary
|
||||
{
|
||||
~ProtobufLibrary ()
|
||||
{
|
||||
google::protobuf::ShutdownProtobufLibrary();
|
||||
}
|
||||
};
|
||||
|
||||
// Must be outside the namespace for obvious reasons
|
||||
//
|
||||
int main (int argc, char** argv)
|
||||
{
|
||||
//
|
||||
// These debug heap calls do nothing in release or non Visual Studio builds.
|
||||
//
|
||||
|
||||
// Checks the heap at every allocation and deallocation (slow).
|
||||
//
|
||||
//beast::Debug::setAlwaysCheckHeap (false);
|
||||
|
||||
// Keeps freed memory blocks and fills them with a guard value.
|
||||
//
|
||||
//beast::Debug::setHeapDelayedFree (false);
|
||||
|
||||
// At exit, reports all memory blocks which have not been freed.
|
||||
//
|
||||
#if RIPPLE_DUMP_LEAKS_ON_EXIT
|
||||
beast::Debug::setHeapReportLeaks (true);
|
||||
#else
|
||||
beast::Debug::setHeapReportLeaks (false);
|
||||
#endif
|
||||
|
||||
beast::SharedSingleton <ProtobufLibrary>::get ();
|
||||
|
||||
int result (0);
|
||||
|
||||
ripple::RippleMain rippled;
|
||||
return rippled.runFromMain (argc, argv);
|
||||
|
||||
result = rippled.runFromMain (argc, argv);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user