layout: cleanup in progress layout demand on destroy
This fixes an issue where a layout client that crashed during a layout demand caused river to enter invalid state and potentially soft-lock.
This commit is contained in:
		@ -173,13 +173,14 @@ pub fn destroy(self: *Self) void {
 | 
				
			|||||||
    const node = @fieldParentPtr(std.TailQueue(Self).Node, "data", self);
 | 
					    const node = @fieldParentPtr(std.TailQueue(Self).Node, "data", self);
 | 
				
			||||||
    self.output.layouts.remove(node);
 | 
					    self.output.layouts.remove(node);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // If we are the currently active layout of an output,  clean up. The output
 | 
					    // If we are the currently active layout of an output, clean up.
 | 
				
			||||||
    // will always end up with no layout at this point, so we directly start the
 | 
					    if (self.output.pending.layout == self) {
 | 
				
			||||||
    // transaction.
 | 
					 | 
				
			||||||
    if (self == self.output.pending.layout) {
 | 
					 | 
				
			||||||
        self.output.pending.layout = null;
 | 
					        self.output.pending.layout = null;
 | 
				
			||||||
        self.output.arrangeViews();
 | 
					        if (self.output.layout_demand) |*layout_demand| {
 | 
				
			||||||
        server.root.startTransaction();
 | 
					            layout_demand.deinit();
 | 
				
			||||||
 | 
					            self.output.layout_demand = null;
 | 
				
			||||||
 | 
					            server.root.notifyLayoutDemandDone();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    self.layout.setHandler(?*c_void, handleRequestInert, null, null);
 | 
					    self.layout.setHandler(?*c_void, handleRequestInert, null, null);
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user