fix incorrect mem use after delete

This commit is contained in:
vaxerski 2022-05-14 11:10:50 +02:00
parent bef4d7c9b7
commit 0273d21a77

View file

@ -74,7 +74,6 @@ void Events::listener_destroyLayerSurface(void* owner, void* data) {
// remove the layersurface as it's not used anymore
PMONITOR->m_aLayerSurfaceLists[layersurface->layer].remove(layersurface);
delete layersurface;
// rearrange to fix the reserved areas
if (PMONITOR) {
@ -85,6 +84,8 @@ void Events::listener_destroyLayerSurface(void* owner, void* data) {
wlr_box geomFixed = {layersurface->geometry.x + PMONITOR->vecPosition.x, layersurface->geometry.y + PMONITOR->vecPosition.y, layersurface->geometry.width, layersurface->geometry.height};
g_pHyprRenderer->damageBox(&geomFixed);
}
delete layersurface;
}
void Events::listener_mapLayerSurface(void* owner, void* data) {