output: fix destroying wl and headless outputs (#32)

This commit is contained in:
Ikalco 2024-07-25 16:14:05 -05:00 committed by GitHub
parent a7d77c60ee
commit 0ab8ffa67d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View file

@ -73,6 +73,7 @@ void Aquamarine::CHeadlessOutput::scheduleFrame(const scheduleFrameReason reason
} }
bool Aquamarine::CHeadlessOutput::destroy() { bool Aquamarine::CHeadlessOutput::destroy() {
events.destroy.emit();
std::erase(backend->outputs, self.lock()); std::erase(backend->outputs, self.lock());
return true; return true;
} }

View file

@ -496,6 +496,7 @@ Aquamarine::CWaylandOutput::CWaylandOutput(const std::string& name_, Hyprutils::
Aquamarine::CWaylandOutput::~CWaylandOutput() { Aquamarine::CWaylandOutput::~CWaylandOutput() {
backend->idleCallbacks.clear(); // FIXME: mega hack to avoid a UAF in frame events backend->idleCallbacks.clear(); // FIXME: mega hack to avoid a UAF in frame events
events.destroy.emit();
if (waylandState.xdgToplevel) if (waylandState.xdgToplevel)
waylandState.xdgToplevel->sendDestroy(); waylandState.xdgToplevel->sendDestroy();
if (waylandState.xdgSurface) if (waylandState.xdgSurface)