Close small memory leak.

This commit is contained in:
JoelKatz
2011-12-31 18:09:59 -08:00
parent f720dbd256
commit fe5cb25ffe
2 changed files with 12 additions and 0 deletions

View File

@@ -50,6 +50,8 @@ extern std::string TxnDBInit, LedgerDBInit, WalletDBInit, HashNodeDBInit, NetNod
void Application::run() void Application::run()
{ {
assert(mTxnDB==NULL);
mTxnDB=new DatabaseCon("transaction.db"); mTxnDB=new DatabaseCon("transaction.db");
mTxnDB->getDB()->executeSQL(TxnDBInit.c_str()); mTxnDB->getDB()->executeSQL(TxnDBInit.c_str());
@@ -100,3 +102,12 @@ void Application::run()
//BOOST_LOG_TRIVIAL(info) << "Done."; //BOOST_LOG_TRIVIAL(info) << "Done.";
std::cout << "Done." << std::endl; std::cout << "Done." << std::endl;
} }
Application::~Application()
{
delete mTxnDB;;
delete mLedgerDB;
delete mWalletDB;
delete mHashNodeDB;
delete mNetNodeDB;
}

View File

@@ -56,6 +56,7 @@ class Application
public: public:
Application(); Application();
~Application();
ConnectionPool& getConnectionPool() { return mConnectionPool; } ConnectionPool& getConnectionPool() { return mConnectionPool; }