Handle destruction of Server properly
This commit is contained in:
parent
aaecef8c5c
commit
a3eb33a7b1
2 changed files with 2 additions and 2 deletions
|
@ -9,9 +9,9 @@ pub fn main() !void {
|
||||||
c.wlr_log_init(c.enum_wlr_log_importance.WLR_DEBUG, null);
|
c.wlr_log_init(c.enum_wlr_log_importance.WLR_DEBUG, null);
|
||||||
|
|
||||||
var server = try Server.create(std.heap.c_allocator);
|
var server = try Server.create(std.heap.c_allocator);
|
||||||
|
defer server.destroy();
|
||||||
|
|
||||||
try server.init();
|
try server.init();
|
||||||
defer server.deinit();
|
|
||||||
|
|
||||||
try server.start();
|
try server.start();
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ pub const Server = struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Free allocated memory and clean up
|
/// Free allocated memory and clean up
|
||||||
pub fn deinit(self: Self) void {
|
pub fn destroy(self: Self) void {
|
||||||
c.wl_display_destroy_clients(self.wl_display);
|
c.wl_display_destroy_clients(self.wl_display);
|
||||||
c.wl_display_destroy(self.wl_display);
|
c.wl_display_destroy(self.wl_display);
|
||||||
c.wlr_output_layout_destroy(self.wlr_output_layout);
|
c.wlr_output_layout_destroy(self.wlr_output_layout);
|
||||||
|
|
Loading…
Reference in a new issue