mirror of
https://github.com/hyprwm/aquamarine.git
synced 2025-12-20 04:40:12 +01:00
wayland: Fix backend idleCallbacks destruction (#151)
This commit is contained in:
parent
b236a43699
commit
81498562d0
1 changed files with 6 additions and 3 deletions
|
|
@ -508,7 +508,6 @@ Aquamarine::CWaylandOutput::CWaylandOutput(const std::string& name_, Hyprutils::
|
|||
}
|
||||
|
||||
Aquamarine::CWaylandOutput::~CWaylandOutput() {
|
||||
backend->idleCallbacks.clear(); // FIXME: mega hack to avoid a UAF in frame events
|
||||
events.destroy.emit();
|
||||
if (waylandState.xdgToplevel)
|
||||
waylandState.xdgToplevel->sendDestroy();
|
||||
|
|
@ -769,8 +768,12 @@ void Aquamarine::CWaylandOutput::scheduleFrame(const scheduleFrameReason reason)
|
|||
|
||||
if (waylandState.frameCallback)
|
||||
frameScheduledWhileWaiting = true;
|
||||
else
|
||||
backend->idleCallbacks.emplace_back([this]() { sendFrameAndSetCallback(); });
|
||||
else {
|
||||
backend->idleCallbacks.emplace_back([w = self]() {
|
||||
if (auto o = w.lock())
|
||||
o->sendFrameAndSetCallback();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Aquamarine::CWaylandBuffer::CWaylandBuffer(SP<IBuffer> buffer_, Hyprutils::Memory::CWeakPointer<CWaylandBackend> backend_) : buffer(buffer_), backend(backend_) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue