From 277ef4b2e35ce25d0d473208fcefa9548230b52a Mon Sep 17 00:00:00 2001 From: pajlada Date: Sun, 6 Dec 2020 15:34:40 +0100 Subject: [PATCH] Fix crash when moving splits across windows and closing parent tab (#2259) --- CHANGELOG.md | 1 + src/widgets/splits/SplitContainer.cpp | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f52032b6..c8067f797 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ - Bugfix: Fix a bug that caused `Ignore page` to fall into an infinity loop with an empty pattern and regex enabled (#2125) - Bugfix: Fix a crash caused by FrankerFaceZ responding with invalid emote links (#2191) - Bugfix: Fix a freeze caused by ignored & replaced phrases followed by Twitch Emotes (#2231) +- Bugfix: Fix a crash bug that occurred when moving splits across windows and closing the "parent tab" (#2249, #2259) - Dev: Updated minimum required Qt framework version to 5.12. (#2210) ## 2.2.2 diff --git a/src/widgets/splits/SplitContainer.cpp b/src/widgets/splits/SplitContainer.cpp index 91f4cca59..7a48b6700 100644 --- a/src/widgets/splits/SplitContainer.cpp +++ b/src/widgets/splits/SplitContainer.cpp @@ -211,19 +211,19 @@ void SplitContainer::addSplit(Split *split) this->refreshTab(); - split->getChannelView().tabHighlightRequested.connect( - [this](HighlightState state) { - if (this->tab_ != nullptr) - { - this->tab_->setHighlightState(state); - } - }); + this->managedConnect(split->getChannelView().tabHighlightRequested, + [this](HighlightState state) { + if (this->tab_ != nullptr) + { + this->tab_->setHighlightState(state); + } + }); - split->getChannelView().liveStatusChanged.connect([this]() { + this->managedConnect(split->getChannelView().liveStatusChanged, [this]() { this->refreshTabLiveStatus(); }); - split->focused.connect([this, split] { + this->managedConnect(split->focused, [this, split] { this->setSelected(split); });