# HG changeset patch # User unc0rr # Date 1355429520 -14400 # Node ID 734b069a418eccbc69990847aa47c3f09b362f91 # Parent 9cdfcb5b7ddd9b60d35b777d4fbafa21c774b7ba Delete poller when game is over diff -r 9cdfcb5b7ddd -r 734b069a418e QTfrontend/game.cpp --- a/QTfrontend/game.cpp Sat Dec 08 22:53:23 2012 +0400 +++ b/QTfrontend/game.cpp Fri Dec 14 00:12:00 2012 +0400 @@ -39,7 +39,8 @@ TCPBase(0) , ammostr(ammo) , m_pTeamSelWidget(pTeamSelWidget) - , m_conn(NULL) + , m_conn(0) + , m_poller(0) { this->config = config; this->gamecfg = gamecfg; @@ -462,7 +463,10 @@ else emit HaveRecord(rtNeither, demo); }*/ + game->SetGameState(gsStopped); + + delete game->m_poller; } void HWGame::onEngineMessage(void *context, const uint8_t *em, size_t size) @@ -489,5 +493,5 @@ flib_gameconn_onErrorMessage(m_conn, onErrorMessage, this); flib_gameconn_onGameRecorded(m_conn, onGameRecorded, this); - new FrontLibPoller((void (*)(void *))flib_gameconn_tick, m_conn, this); + m_poller = new FrontLibPoller((void (*)(void *))flib_gameconn_tick, m_conn, this); } diff -r 9cdfcb5b7ddd -r 734b069a418e QTfrontend/game.h --- a/QTfrontend/game.h Sat Dec 08 22:53:23 2012 +0400 +++ b/QTfrontend/game.h Fri Dec 14 00:12:00 2012 +0400 @@ -48,7 +48,7 @@ rtNeither, }; -bool checkForDir(const QString & dir); +class FrontLibPoller; class HWGame : public TCPBase { @@ -105,6 +105,7 @@ GameType gameType; flib_gameconn * m_conn; + FrontLibPoller * m_poller; void commonConfig(); void SendConfig(); diff -r 9cdfcb5b7ddd -r 734b069a418e QTfrontend/hwform.cpp --- a/QTfrontend/hwform.cpp Sat Dec 08 22:53:23 2012 +0400 +++ b/QTfrontend/hwform.cpp Fri Dec 14 00:12:00 2012 +0400 @@ -112,6 +112,8 @@ GameUIConfig* HWForm::config = NULL; +bool checkForDir(const QString & dir); + HWForm::HWForm(QWidget *parent, QString styleSheet) : QMainWindow(parent) , game(0)