diff options
| author | Isaac Freund <ifreund@ifreund.xyz> | 2021-09-30 16:45:14 +0200 |
|---|---|---|
| committer | Isaac Freund <ifreund@ifreund.xyz> | 2021-09-30 16:45:14 +0200 |
| commit | 8ec0e30fd76d528a999846496fc1ac2302424a53 (patch) | |
| tree | c59a5ebfe47561965600788cf8777e31d742076e | |
| parent | 6616d323530167737ba8a0807cbaa49d832c135e (diff) | |
| download | river-8ec0e30fd76d528a999846496fc1ac2302424a53.tar.gz river-8ec0e30fd76d528a999846496fc1ac2302424a53.tar.xz | |
Subsurface: remove commit listener in destroy()
Currently if destroy() is called while a subsurface is mapped a dangling
commit listener is left behind. This is obivously a problem, so check if
the subsurface is mapped in destroy() and remove the listener if needed.
| -rw-r--r-- | river/Subsurface.zig | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/river/Subsurface.zig b/river/Subsurface.zig index 0880163..bf7c341 100644 --- a/river/Subsurface.zig +++ b/river/Subsurface.zig @@ -95,6 +95,8 @@ pub fn destroy(subsurface: *Subsurface) void { subsurface.unmap.link.remove(); subsurface.new_subsurface.link.remove(); + if (subsurface.wlr_subsurface.mapped) subsurface.commit.link.remove(); + Subsurface.destroySubsurfaces(subsurface.wlr_subsurface.surface); subsurface.wlr_subsurface.data = 0; |
