xdg-toplevel: remove listeners before view destroy
Currently in handleUnmap() we call View.unmap() before removing listeners. However View.unmap() may destroy the view before returning if the transaction started doesn't have to wait on any configures. To ensure that we don't try to remove listeners which have already been free'd, do this before calling View.unmap().
This commit is contained in:
@ -19,6 +19,7 @@ const Self = @This();
|
||||
|
||||
const build_options = @import("build_options");
|
||||
const std = @import("std");
|
||||
const assert = std.debug.assert;
|
||||
const math = std.math;
|
||||
const os = std.os;
|
||||
const wlr = @import("wlroots");
|
||||
@ -486,7 +487,9 @@ pub fn map(self: *Self) void {
|
||||
pub fn unmap(self: *Self) void {
|
||||
log.debug("view '{s}' unmapped", .{self.getTitle()});
|
||||
|
||||
assert(!self.destroying);
|
||||
self.destroying = true;
|
||||
|
||||
if (self.saved_buffers.items.len == 0) self.saveBuffers();
|
||||
|
||||
if (self.opacity_timer != null) {
|
||||
|
Reference in New Issue
Block a user