Skip to content

Commit

Permalink
Seat: do a better job of cleaning up listeners
Browse files Browse the repository at this point in the history
I thought this should be fine as river won't yield to the event loop
when Seat.deinit() is called before the wlroots seat is destroyed, but
a segfault on exit has been reported with a stack trace mentioning
wlr_seat_destroy(). Let's hope this clears that up.
  • Loading branch information
ifreund committed Jan 2, 2022
1 parent e16eabd commit 1c51575
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions river/Seat.zig
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ pub fn deinit(self: *Self) void {
self.focus_stack.remove(node);
util.gpa.destroy(node);
}

self.request_set_selection.link.remove();
self.request_start_drag.link.remove();
self.start_drag.link.remove();
if (self.pointer_drag) self.pointer_drag_destroy.link.remove();
self.request_set_primary_selection.link.remove();
}

/// Set the current focus. If a visible view is passed it will be focused.
Expand Down

0 comments on commit 1c51575

Please sign in to comment.