From 3b9ac7456a4b63c34325d43906aae2d171a6b27d Mon Sep 17 00:00:00 2001 From: Daniel Sage <24928223+dnsge@users.noreply.github.com> Date: Sat, 23 Jul 2022 09:42:41 -0400 Subject: [PATCH] Fix crash when closing all tabs on macOS (#3860) Co-authored-by: Rasmus Karlsson --- CHANGELOG.md | 2 +- src/widgets/splits/Split.cpp | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2f8582eb..f41f802a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,7 +40,7 @@ - Bugfix: Fixed message only showing a maximum of one global FrankerFaceZ badge even if the user has multiple. (#3818) - Bugfix: Add icon in the CMake macOS bundle. (#3832) - Bugfix: Adopt popup windows in order to force floating behavior on some window managers. (#3836) -- Bugfix: Fix split focusing being broken in certain circumstances when the "Show input when it's empty" setting was disabled. (#3838) +- Bugfix: Fix split focusing being broken in certain circumstances when the "Show input when it's empty" setting was disabled. (#3838, #3860) - Bugfix: Always refresh tab when a contained split's channel is set. (#3849) - Dev: Remove official support for QMake. (#3839) - Dev: Rewrite LimitedQueue (#3798) diff --git a/src/widgets/splits/Split.cpp b/src/widgets/splits/Split.cpp index ae78e6001..d4b8a1ba5 100644 --- a/src/widgets/splits/Split.cpp +++ b/src/widgets/splits/Split.cpp @@ -209,14 +209,16 @@ Split::Split(QWidget *parent) } }); - this->input_->ui_.textEdit->focused.connect([this] { - // Forward textEdit's focused event - this->focused.invoke(); - }); - this->input_->ui_.textEdit->focusLost.connect([this] { - // Forward textEdit's focusLost event - this->focusLost.invoke(); - }); + this->signalHolder_.managedConnect(this->input_->ui_.textEdit->focused, + [this] { + // Forward textEdit's focused event + this->focused.invoke(); + }); + this->signalHolder_.managedConnect(this->input_->ui_.textEdit->focusLost, + [this] { + // Forward textEdit's focusLost event + this->focusLost.invoke(); + }); this->input_->ui_.textEdit->imagePasted.connect( [this](const QMimeData *source) { if (!getSettings()->imageUploaderEnabled)