mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-12-27 17:55:24 +03:00
drm-syncobj: fixup fd leak with timelines
This commit is contained in:
parent
f36c625e37
commit
99e9cb5107
@ -114,6 +114,11 @@ CDRMSyncobjTimelineResource::CDRMSyncobjTimelineResource(SP<CWpLinuxDrmSyncobjTi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CDRMSyncobjTimelineResource::~CDRMSyncobjTimelineResource() {
|
||||||
|
if (fd >= 0)
|
||||||
|
close(fd);
|
||||||
|
}
|
||||||
|
|
||||||
SP<CDRMSyncobjTimelineResource> CDRMSyncobjTimelineResource::fromResource(wl_resource* res) {
|
SP<CDRMSyncobjTimelineResource> CDRMSyncobjTimelineResource::fromResource(wl_resource* res) {
|
||||||
auto data = (CDRMSyncobjTimelineResource*)(((CWpLinuxDrmSyncobjTimelineV1*)wl_resource_get_user_data(res))->data());
|
auto data = (CDRMSyncobjTimelineResource*)(((CWpLinuxDrmSyncobjTimelineV1*)wl_resource_get_user_data(res))->data());
|
||||||
return data ? data->self.lock() : nullptr;
|
return data ? data->self.lock() : nullptr;
|
||||||
|
@ -34,6 +34,7 @@ class CDRMSyncobjSurfaceResource {
|
|||||||
class CDRMSyncobjTimelineResource {
|
class CDRMSyncobjTimelineResource {
|
||||||
public:
|
public:
|
||||||
CDRMSyncobjTimelineResource(SP<CWpLinuxDrmSyncobjTimelineV1> resource_, int fd_);
|
CDRMSyncobjTimelineResource(SP<CWpLinuxDrmSyncobjTimelineV1> resource_, int fd_);
|
||||||
|
~CDRMSyncobjTimelineResource();
|
||||||
static SP<CDRMSyncobjTimelineResource> fromResource(wl_resource*);
|
static SP<CDRMSyncobjTimelineResource> fromResource(wl_resource*);
|
||||||
|
|
||||||
bool good();
|
bool good();
|
||||||
|
Loading…
Reference in New Issue
Block a user