summaryrefslogtreecommitdiff
path: root/src/gui/chat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r--src/gui/chat.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index 5c15580d..8961b704 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -34,6 +34,7 @@
#include "../configuration.h"
#include "../localplayer.h"
+#include "../utils/dtor.h"
#include "../utils/stringutils.h"
#ifdef TMWSERV_SUPPORT
@@ -94,6 +95,7 @@ ChatWindow::~ChatWindow()
config.setValue("ReturnToggles", mReturnToggles ? "1" : "0");
delete mRecorder;
#endif
+ delete_all(mTabs);
delete mItemLinkHandler;
}
@@ -140,13 +142,15 @@ void ChatWindow::logic()
void ChatWindow::chatLog(std::string line, int own, std::string channelName,
bool ignoreRecord)
{
- if(channelName.empty())
+ ChatTab *tab;
+ if(!channelName.empty())
+ tab = findTab(channelName);
+ else
#ifdef TMWSERV_SUPPORT
- channelName = getFocused();
+ tab = getFocused();
#else
- channelName = "General";
+ tab = findTab("General");
#endif
- ChatTab *tab = findTab(channelName);
tab->chatLog(line, own, ignoreRecord);
}