mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Fix crash resulting from a mutex deadlock when switching users (#4675)
This commit is contained in:
parent
335dff53af
commit
65a14fb95b
|
@ -7,6 +7,7 @@
|
||||||
- Minor: Added `/shoutout <username>` commands to shoutout specified user. (#4638)
|
- Minor: Added `/shoutout <username>` commands to shoutout specified user. (#4638)
|
||||||
- Minor: Improved editing hotkeys. (#4628)
|
- Minor: Improved editing hotkeys. (#4628)
|
||||||
- Bugfix: Fixed generation of crashdumps by the browser-extension process when the browser was closed. (#4667)
|
- Bugfix: Fixed generation of crashdumps by the browser-extension process when the browser was closed. (#4667)
|
||||||
|
- Bugfix: Fixed a crash when opening and closing a reply thread and switching the user. (#4675)
|
||||||
- Dev: Added command to set Qt's logging filter/rules at runtime (`/c2-set-logging-rules`). (#4637)
|
- Dev: Added command to set Qt's logging filter/rules at runtime (`/c2-set-logging-rules`). (#4637)
|
||||||
- Dev: Added the ability to see & load custom themes from the Themes directory. No stable promises are made of this feature, changes might be made that breaks custom themes without notice. (#4570)
|
- Dev: Added the ability to see & load custom themes from the Themes directory. No stable promises are made of this feature, changes might be made that breaks custom themes without notice. (#4570)
|
||||||
- Dev: Added test cases for emote and tab completion. (#4644)
|
- Dev: Added test cases for emote and tab completion. (#4644)
|
||||||
|
|
|
@ -138,26 +138,25 @@ void ReplyThreadPopup::addMessagesFromThread()
|
||||||
this->setWindowTitle(TEXT_TITLE.arg(this->thread_->root()->loginName,
|
this->setWindowTitle(TEXT_TITLE.arg(this->thread_->root()->loginName,
|
||||||
sourceChannel->getName()));
|
sourceChannel->getName()));
|
||||||
|
|
||||||
ChannelPtr virtualChannel;
|
|
||||||
if (sourceChannel->isTwitchChannel())
|
if (sourceChannel->isTwitchChannel())
|
||||||
{
|
{
|
||||||
virtualChannel =
|
this->virtualChannel_ =
|
||||||
std::make_shared<TwitchChannel>(sourceChannel->getName());
|
std::make_shared<TwitchChannel>(sourceChannel->getName());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
virtualChannel = std::make_shared<Channel>(sourceChannel->getName(),
|
this->virtualChannel_ = std::make_shared<Channel>(
|
||||||
Channel::Type::None);
|
sourceChannel->getName(), Channel::Type::None);
|
||||||
}
|
}
|
||||||
|
|
||||||
this->ui_.threadView->setChannel(virtualChannel);
|
this->ui_.threadView->setChannel(this->virtualChannel_);
|
||||||
this->ui_.threadView->setSourceChannel(sourceChannel);
|
this->ui_.threadView->setSourceChannel(sourceChannel);
|
||||||
|
|
||||||
auto overrideFlags =
|
auto overrideFlags =
|
||||||
boost::optional<MessageFlags>(this->thread_->root()->flags);
|
boost::optional<MessageFlags>(this->thread_->root()->flags);
|
||||||
overrideFlags->set(MessageFlag::DoNotLog);
|
overrideFlags->set(MessageFlag::DoNotLog);
|
||||||
|
|
||||||
virtualChannel->addMessage(this->thread_->root(), overrideFlags);
|
this->virtualChannel_->addMessage(this->thread_->root(), overrideFlags);
|
||||||
for (const auto &msgRef : this->thread_->replies())
|
for (const auto &msgRef : this->thread_->replies())
|
||||||
{
|
{
|
||||||
if (auto msg = msgRef.lock())
|
if (auto msg = msgRef.lock())
|
||||||
|
@ -165,24 +164,24 @@ void ReplyThreadPopup::addMessagesFromThread()
|
||||||
auto overrideFlags = boost::optional<MessageFlags>(msg->flags);
|
auto overrideFlags = boost::optional<MessageFlags>(msg->flags);
|
||||||
overrideFlags->set(MessageFlag::DoNotLog);
|
overrideFlags->set(MessageFlag::DoNotLog);
|
||||||
|
|
||||||
virtualChannel->addMessage(msg, overrideFlags);
|
this->virtualChannel_->addMessage(msg, overrideFlags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this->messageConnection_ =
|
this->messageConnection_ =
|
||||||
std::make_unique<pajlada::Signals::ScopedConnection>(
|
std::make_unique<pajlada::Signals::ScopedConnection>(
|
||||||
sourceChannel->messageAppended.connect(
|
sourceChannel->messageAppended.connect([this](MessagePtr &message,
|
||||||
[this, virtualChannel](MessagePtr &message, auto) {
|
auto) {
|
||||||
if (message->replyThread == this->thread_)
|
if (message->replyThread == this->thread_)
|
||||||
{
|
{
|
||||||
auto overrideFlags =
|
auto overrideFlags =
|
||||||
boost::optional<MessageFlags>(message->flags);
|
boost::optional<MessageFlags>(message->flags);
|
||||||
overrideFlags->set(MessageFlag::DoNotLog);
|
overrideFlags->set(MessageFlag::DoNotLog);
|
||||||
|
|
||||||
// same reply thread, add message
|
// same reply thread, add message
|
||||||
virtualChannel->addMessage(message, overrideFlags);
|
this->virtualChannel_->addMessage(message, overrideFlags);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReplyThreadPopup::updateInputUI()
|
void ReplyThreadPopup::updateInputUI()
|
||||||
|
|
|
@ -34,6 +34,8 @@ private:
|
||||||
std::shared_ptr<MessageThread> thread_;
|
std::shared_ptr<MessageThread> thread_;
|
||||||
// The channel that the reply thread is in
|
// The channel that the reply thread is in
|
||||||
ChannelPtr channel_;
|
ChannelPtr channel_;
|
||||||
|
// The channel for the `threadView`
|
||||||
|
ChannelPtr virtualChannel_;
|
||||||
Split *split_;
|
Split *split_;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
|
Loading…
Reference in a new issue