diff --git a/Application.cpp b/Application.cpp index 773bf36ca6..d93abc8d28 100644 --- a/Application.cpp +++ b/Application.cpp @@ -50,6 +50,8 @@ extern std::string TxnDBInit, LedgerDBInit, WalletDBInit, HashNodeDBInit, NetNod void Application::run() { + assert(mTxnDB==NULL); + mTxnDB=new DatabaseCon("transaction.db"); mTxnDB->getDB()->executeSQL(TxnDBInit.c_str()); @@ -100,3 +102,12 @@ void Application::run() //BOOST_LOG_TRIVIAL(info) << "Done."; std::cout << "Done." << std::endl; } + +Application::~Application() +{ + delete mTxnDB;; + delete mLedgerDB; + delete mWalletDB; + delete mHashNodeDB; + delete mNetNodeDB; +} \ No newline at end of file diff --git a/Application.h b/Application.h index ca0c945a64..8c92406d52 100644 --- a/Application.h +++ b/Application.h @@ -56,6 +56,7 @@ class Application public: Application(); + ~Application(); ConnectionPool& getConnectionPool() { return mConnectionPool; }