code: handle out of memory as well as possible
This commit is contained in:
@ -76,6 +76,9 @@ fn handleNewPopup(listener: ?*c.wl_listener, data: ?*c_void) callconv(.C) void {
|
||||
const wlr_xdg_popup = util.voidCast(c.wlr_xdg_popup, data.?);
|
||||
|
||||
// This will free itself on destroy
|
||||
var xdg_popup = util.gpa.create(Self) catch unreachable;
|
||||
var xdg_popup = util.gpa.create(Self) catch {
|
||||
c.wl_resource_post_no_memory(wlr_xdg_popup.resource);
|
||||
return;
|
||||
};
|
||||
xdg_popup.init(self.output, self.parent_box, wlr_xdg_popup);
|
||||
}
|
||||
|
Reference in New Issue
Block a user