LayerSurface: fix use-after-free on destroy
The scene_layer_surface may be destroyed before handleDestroy is called, which means we can't rely on it to access the wlr_layer_surface in destroyPopups().
This commit is contained in:
@ -283,7 +283,7 @@ pub fn removeOutput(root: *Self, output: *Output) void {
|
||||
while (it.next()) |scene_node| {
|
||||
assert(scene_node.type == .tree);
|
||||
if (@intToPtr(?*SceneNodeData, scene_node.data)) |node_data| {
|
||||
node_data.data.layer_surface.scene_layer_surface.layer_surface.destroy();
|
||||
node_data.data.layer_surface.wlr_layer_surface.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user