mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 20:25:59 +01:00
popups: fix heap-use-after-free
This commit is contained in:
parent
cf51a31807
commit
3a3a3f7bdb
1 changed files with 5 additions and 5 deletions
|
@ -173,11 +173,6 @@ void Events::listener_unmapPopupXDG(void* owner, void* data) {
|
|||
|
||||
ASSERT(PPOPUP);
|
||||
|
||||
if (PPOPUP->parentWindow)
|
||||
std::erase(PPOPUP->parentWindow->m_lPopupSurfaces, PPOPUP->popup->base->surface);
|
||||
else if (PPOPUP->parentLS)
|
||||
std::erase(PPOPUP->parentLS->popupSurfaces, PPOPUP->popup->base->surface);
|
||||
|
||||
SubsurfaceTree::destroySurfaceTree(PPOPUP->pSurfaceTree);
|
||||
|
||||
int lx = 0, ly = 0;
|
||||
|
@ -188,6 +183,11 @@ void Events::listener_unmapPopupXDG(void* owner, void* data) {
|
|||
|
||||
g_pHyprRenderer->damageBox(lx - extents.x, ly - extents.y, extents.width + 2, extents.height + 2);
|
||||
|
||||
if (PPOPUP->parentWindow)
|
||||
std::erase(PPOPUP->parentWindow->m_lPopupSurfaces, PPOPUP->popup->base->surface);
|
||||
else if (PPOPUP->parentLS)
|
||||
std::erase(PPOPUP->parentLS->popupSurfaces, PPOPUP->popup->base->surface);
|
||||
|
||||
PPOPUP->pSurfaceTree = nullptr;
|
||||
|
||||
g_pInputManager->simulateMouseMovement(); // to focus and return back to an appropriate surface
|
||||
|
|
Loading…
Reference in a new issue