Commit 5e602434 authored by Xaver Hugl's avatar Xaver Hugl
Browse files

backends/drm: fix memory leak

parent 4be81e01
Pipeline #209381 passed with stage
in 12 minutes and 18 seconds
......@@ -225,7 +225,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);
DrmUniquePtr<drmModeLesseeListRes> lessees{drmModeListLessees(m_fd)};
for (const auto &output : qAsConst(m_drmOutputs)) {
if (output->lease()) {
bool leaseActive = false;
......
......@@ -137,6 +137,15 @@ struct DrmDeleter<drmModeRes>
}
};
template<>
struct DrmDeleter<drmModeLesseeListRes>
{
void operator()(drmModeLesseeListRes *ptr)
{
drmFree(ptr);
}
};
template<typename T>
using DrmUniquePtr = std::unique_ptr<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