Browse Source

fixed leak in q_webthreeconnector in mainwin

cl-refactor
Marek Kotewicz 10 years ago
parent
commit
0305a8480f
  1. 3
      alethzero/MainWin.cpp
  2. 2
      alethzero/MainWin.h

3
alethzero/MainWin.cpp

@ -153,8 +153,7 @@ Main::Main(QWidget *parent) :
m_webThree.reset(new WebThreeDirect(string("AlethZero/v") + dev::Version + "/" DEV_QUOTED(ETH_BUILD_TYPE) "/" DEV_QUOTED(ETH_BUILD_PLATFORM), getDataDir() + "/AlethZero", false, {"eth", "shh"}));
// w3stubserver, on dealloc, deletes m_qwebConnector
m_qwebConnector = new QWebThreeConnector(); // owned by WebThreeStubServer
m_qwebConnector.reset(new QWebThreeConnector());
m_server.reset(new OurWebThreeStubServer(*m_qwebConnector, *web3(), keysAsVector(m_myKeys)));
connect(&*m_server, SIGNAL(onNewId(QString)), SLOT(addNewId(QString)));
m_server->setIdentities(keysAsVector(owned()));

2
alethzero/MainWin.h

@ -256,7 +256,7 @@ private:
QString m_logHistory;
bool m_logChanged = true;
QWebThreeConnector* m_qwebConnector;
std::unique_ptr<QWebThreeConnector> m_qwebConnector;
std::unique_ptr<OurWebThreeStubServer> m_server;
QWebThree* m_qweb = nullptr;
};

Loading…
Cancel
Save