Commit dbf52ebd authored by Vlad Zahorodnii's avatar Vlad Zahorodnii Committed by Aleix Pol Gonzalez

launcher: Fix a file descriptor leak

The file descriptor must be closed after sending a ReleaseDevice request.
parent f369a355
......@@ -378,14 +378,15 @@ void LogindIntegration::releaseDevice(int fd)
struct stat st;
if (fstat(fd, &st) < 0) {
qCDebug(KWIN_CORE) << "Could not stat the file descriptor";
return;
} else {
QDBusMessage message = QDBusMessage::createMethodCall(m_sessionControllerService,
m_sessionPath,
m_sessionControllerSessionInterface,
QStringLiteral("ReleaseDevice"));
message.setArguments(QVariantList({QVariant(major(st.st_rdev)), QVariant(minor(st.st_rdev))}));
m_bus.asyncCall(message);
}
QDBusMessage message = QDBusMessage::createMethodCall(m_sessionControllerService,
m_sessionPath,
m_sessionControllerSessionInterface,
QStringLiteral("ReleaseDevice"));
message.setArguments(QVariantList({QVariant(major(st.st_rdev)), QVariant(minor(st.st_rdev))}));
m_bus.asyncCall(message);
close(fd);
}
void LogindIntegration::pauseDevice(uint devMajor, uint devMinor, const QString &type)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment