mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-20 22:43:47 -07:00
output: avoid crashes when binding a defunct wl_output global
ref #6508
This commit is contained in:
@@ -9,6 +9,9 @@ CWLOutputResource::CWLOutputResource(SP<CWlOutput> resource_, SP<CMonitor> pMoni
|
|||||||
|
|
||||||
pClient = resource->client();
|
pClient = resource->client();
|
||||||
|
|
||||||
|
if (!monitor)
|
||||||
|
return;
|
||||||
|
|
||||||
resource->setOnDestroy([this](CWlOutput* r) {
|
resource->setOnDestroy([this](CWlOutput* r) {
|
||||||
if (monitor && PROTO::outputs.contains(monitor->szName))
|
if (monitor && PROTO::outputs.contains(monitor->szName))
|
||||||
PROTO::outputs.at(monitor->szName)->destroyResource(this);
|
PROTO::outputs.at(monitor->szName)->destroyResource(this);
|
||||||
@@ -69,6 +72,9 @@ CWLOutputProtocol::CWLOutputProtocol(const wl_interface* iface, const int& ver,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CWLOutputProtocol::bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id) {
|
void CWLOutputProtocol::bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id) {
|
||||||
|
if (defunct)
|
||||||
|
Debug::log(WARN, "[wl_output] Binding a wl_output that's inert?? Possible client bug.");
|
||||||
|
|
||||||
const auto RESOURCE = m_vOutputs.emplace_back(makeShared<CWLOutputResource>(makeShared<CWlOutput>(client, ver, id), monitor.lock()));
|
const auto RESOURCE = m_vOutputs.emplace_back(makeShared<CWLOutputResource>(makeShared<CWlOutput>(client, ver, id), monitor.lock()));
|
||||||
|
|
||||||
if (!RESOURCE->good()) {
|
if (!RESOURCE->good()) {
|
||||||
|
Reference in New Issue
Block a user