From 168203c2185b7cf75c685b0557293720cdda208c Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Fri, 19 Feb 2010 15:38:58 -0700 Subject: Prevent issues when channels are cleared after the ChatWindow --- src/channel.cpp | 5 ++++- src/gui/widgets/channeltab.cpp | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/channel.cpp b/src/channel.cpp index 38329e0c..fcc8c6f8 100644 --- a/src/channel.cpp +++ b/src/channel.cpp @@ -35,5 +35,8 @@ Channel::Channel(short id, Channel::~Channel() { - delete mTab; + if (mTab) + { + delete mTab; + } } diff --git a/src/gui/widgets/channeltab.cpp b/src/gui/widgets/channeltab.cpp index 0fce98bb..aac1cdb6 100644 --- a/src/gui/widgets/channeltab.cpp +++ b/src/gui/widgets/channeltab.cpp @@ -37,6 +37,9 @@ ChannelTab::ChannelTab(Channel *channel) : ChannelTab::~ChannelTab() { + // Clear tab so the channel won't try to (if the ChatWindow is cleared + // before the channels are, we'll run into issues without this) + mChannel->setTab(0); } void ChannelTab::handleInput(const std::string &msg) -- cgit v1.2.3-70-g09d2