mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-26 19:49:48 +01:00
output: avoid crashes when binding a defunct wl_output global
ref #6508
This commit is contained in:
parent
6c24dc0bb1
commit
77f44bfcab
1 changed files with 6 additions and 0 deletions
|
@ -9,6 +9,9 @@ CWLOutputResource::CWLOutputResource(SP<CWlOutput> resource_, SP<CMonitor> pMoni
|
|||
|
||||
pClient = resource->client();
|
||||
|
||||
if (!monitor)
|
||||
return;
|
||||
|
||||
resource->setOnDestroy([this](CWlOutput* r) {
|
||||
if (monitor && PROTO::outputs.contains(monitor->szName))
|
||||
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) {
|
||||
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()));
|
||||
|
||||
if (!RESOURCE->good()) {
|
||||
|
|
Loading…
Reference in a new issue