From 61eb8ce75b451958da5557d51fbd382ca94ea009 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Fri, 1 Oct 2021 18:38:52 +0300 Subject: [PATCH] Fix double close() AbstractDataSource::requestData() takes the ownership of the file descriptor. So the second close() will close an already closed fd. --- src/debug_console.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/debug_console.cpp b/src/debug_console.cpp index 15d131d903..2fe99125fd 100644 --- a/src/debug_console.cpp +++ b/src/debug_console.cpp @@ -1704,7 +1704,6 @@ void DataSourceModel::setSource(KWaylandServer::AbstractDataSource *source) m_source = source; m_data.clear(); if (source) { - const auto client = source->client(); m_data.resize(m_source->mimeTypes().size()); for (auto type = m_source->mimeTypes().cbegin(); type != m_source->mimeTypes().cend(); ++type) { int pipeFds[2]; @@ -1712,9 +1711,6 @@ void DataSourceModel::setSource(KWaylandServer::AbstractDataSource *source) continue; } source->requestData(*type, pipeFds[1]); - if (client && client != waylandServer()->internalConnection()->client()) { - close(pipeFds[1]); - } QFuture data = QtConcurrent::run(readData, pipeFds[0]); auto watcher = new QFutureWatcher(this); watcher->setFuture(data);