Commit cad6b100 authored by Xaver Hugl's avatar Xaver Hugl
Browse files

backends/drm: fix memory leak

(cherry picked from commit 5e602434)
parent 2a2bb539
Pipeline #209390 failed with stage
in 3 minutes and 3 seconds
......@@ -233,7 +233,7 @@ bool DrmGpu::updateOutputs()
// In principle these things are supposed to be detected through the wayland protocol.
// In practice SteamVR doesn't always behave correctly
auto lessees = drmModeListLessees(m_fd);
DrmScopedPointer<drmModeLesseeListRes> lessees{drmModeListLessees(m_fd)};
for (const auto &leaseOutput : qAsConst(m_leaseOutputs)) {
if (leaseOutput->lease()) {
bool leaseActive = false;
......
......@@ -138,6 +138,15 @@ struct DrmDeleter<drmModeRes>
}
};
template<>
struct DrmDeleter<drmModeLesseeListRes>
{
void operator()(drmModeLesseeListRes *ptr)
{
drmFree(ptr);
}
};
template<typename T>
using DrmScopedPointer = QScopedPointer<T, DrmDeleter<T>>;
......
Supports Markdown
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