mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
fix crash bug when closing notebook
This commit is contained in:
parent
5208e0f2fd
commit
971489f8f1
2 changed files with 4 additions and 3 deletions
|
@ -36,6 +36,7 @@ ChatWidget::ChatWidget(QWidget *parent)
|
||||||
|
|
||||||
ChatWidget::~ChatWidget()
|
ChatWidget::~ChatWidget()
|
||||||
{
|
{
|
||||||
|
detachChannel();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<Channel> ChatWidget::getChannel() const
|
std::shared_ptr<Channel> ChatWidget::getChannel() const
|
||||||
|
@ -69,7 +70,7 @@ void ChatWidget::setChannelName(const QString &name)
|
||||||
if (!_channelName.isEmpty()) {
|
if (!_channelName.isEmpty()) {
|
||||||
ChannelManager::getInstance().removeChannel(_channelName);
|
ChannelManager::getInstance().removeChannel(_channelName);
|
||||||
|
|
||||||
detachChannel(_channel);
|
detachChannel();
|
||||||
}
|
}
|
||||||
|
|
||||||
// update members
|
// update members
|
||||||
|
@ -128,7 +129,7 @@ void ChatWidget::attachChannel(SharedChannel channel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatWidget::detachChannel(std::shared_ptr<Channel> channel)
|
void ChatWidget::detachChannel()
|
||||||
{
|
{
|
||||||
// on message added
|
// on message added
|
||||||
_messageAppendedConnection.disconnect();
|
_messageAppendedConnection.disconnect();
|
||||||
|
|
|
@ -42,7 +42,7 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void attachChannel(std::shared_ptr<Channel> _channel);
|
void attachChannel(std::shared_ptr<Channel> _channel);
|
||||||
void detachChannel(std::shared_ptr<Channel> _channel);
|
void detachChannel();
|
||||||
|
|
||||||
messages::LimitedQueue<messages::SharedMessageRef> _messages;
|
messages::LimitedQueue<messages::SharedMessageRef> _messages;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue