river: fix a few leaks
This commit is contained in:
parent
4d2f5bb32d
commit
f5f9b526a0
@ -89,6 +89,8 @@ fn handleDestroy(listener: *wl.Listener(*wlr.LayerSurfaceV1), _: *wlr.LayerSurfa
|
|||||||
|
|
||||||
layer_surface.destroyPopups();
|
layer_surface.destroyPopups();
|
||||||
|
|
||||||
|
layer_surface.popup_tree.node.destroy();
|
||||||
|
|
||||||
util.gpa.destroy(layer_surface);
|
util.gpa.destroy(layer_surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,6 +273,7 @@ fn handleSurface(
|
|||||||
assert(manager.lock != null);
|
assert(manager.lock != null);
|
||||||
|
|
||||||
LockSurface.create(wlr_lock_surface, manager.lock.?) catch {
|
LockSurface.create(wlr_lock_surface, manager.lock.?) catch {
|
||||||
|
log.err("out of memory", .{});
|
||||||
wlr_lock_surface.resource.postNoMemory();
|
wlr_lock_surface.resource.postNoMemory();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ surface_destroy: wl.Listener(void) = wl.Listener(void).init(handleDestroy),
|
|||||||
|
|
||||||
pub fn create(wlr_lock_surface: *wlr.SessionLockSurfaceV1, lock: *wlr.SessionLockV1) error{OutOfMemory}!void {
|
pub fn create(wlr_lock_surface: *wlr.SessionLockSurfaceV1, lock: *wlr.SessionLockV1) error{OutOfMemory}!void {
|
||||||
const lock_surface = try util.gpa.create(LockSurface);
|
const lock_surface = try util.gpa.create(LockSurface);
|
||||||
|
errdefer util.gpa.destroy(lock_surface);
|
||||||
|
|
||||||
lock_surface.* = .{
|
lock_surface.* = .{
|
||||||
.wlr_lock_surface = wlr_lock_surface,
|
.wlr_lock_surface = wlr_lock_surface,
|
||||||
@ -46,6 +47,8 @@ pub fn create(wlr_lock_surface: *wlr.SessionLockSurfaceV1, lock: *wlr.SessionLoc
|
|||||||
|
|
||||||
const output = lock_surface.getOutput();
|
const output = lock_surface.getOutput();
|
||||||
const tree = try output.locked_content.createSceneSubsurfaceTree(wlr_lock_surface.surface);
|
const tree = try output.locked_content.createSceneSubsurfaceTree(wlr_lock_surface.surface);
|
||||||
|
errdefer tree.node.destroy();
|
||||||
|
|
||||||
try SceneNodeData.attach(&tree.node, .{ .lock_surface = lock_surface });
|
try SceneNodeData.attach(&tree.node, .{ .lock_surface = lock_surface });
|
||||||
|
|
||||||
wlr_lock_surface.output.events.mode.add(&lock_surface.output_mode);
|
wlr_lock_surface.output.events.mode.add(&lock_surface.output_mode);
|
||||||
|
@ -358,6 +358,8 @@ fn handleDestroy(listener: *wl.Listener(*wlr.Output), _: *wlr.Output) void {
|
|||||||
output.mode.link.remove();
|
output.mode.link.remove();
|
||||||
output.present.link.remove();
|
output.present.link.remove();
|
||||||
|
|
||||||
|
output.tree.node.destroy();
|
||||||
|
|
||||||
if (output.layout_namespace) |namespace| util.gpa.free(namespace);
|
if (output.layout_namespace) |namespace| util.gpa.free(namespace);
|
||||||
|
|
||||||
output.wlr_output.data = 0;
|
output.wlr_output.data = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user