From 7d60164d939ec6822d74f757748bc66ac981edab Mon Sep 17 00:00:00 2001 From: Tobias Christiansen Date: Wed, 14 Apr 2021 20:05:23 +0200 Subject: [PATCH] FileManager: Don't crash on error in FileOperation did_error() caused the program to crash since the DialogBox tried to run its own Notifier with the same - now invalid because closed - fd. In addition to setting the member that is the Notifier to nullptr we also tell the Notifier that it is not enabled anymore. --- .../Applications/FileManager/FileOperationProgressWidget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Userland/Applications/FileManager/FileOperationProgressWidget.cpp b/Userland/Applications/FileManager/FileOperationProgressWidget.cpp index e79f56c0e1..2e3593332b 100644 --- a/Userland/Applications/FileManager/FileOperationProgressWidget.cpp +++ b/Userland/Applications/FileManager/FileOperationProgressWidget.cpp @@ -167,8 +167,10 @@ void FileOperationProgressWidget::close_pipe() if (!m_helper_pipe) return; m_helper_pipe = nullptr; - if (m_notifier) + if (m_notifier) { + m_notifier->set_enabled(false); m_notifier->on_ready_to_read = nullptr; + } m_notifier = nullptr; }