Skip to content

Commit

Permalink
gtk: use correct function to destroy window
Browse files Browse the repository at this point in the history
adw_application_window_destroy and gtk_application_window_destroy do not
exist. I believe that this didn't trigger a compile error because the
errdefer got compiled out because there are no potential error returns
after this code in the function.
  • Loading branch information
jcollie committed Nov 1, 2024
1 parent e7ccc60 commit 6d8cf55
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/apprt/gtk/Window.zig
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,9 @@ pub fn init(self: *Window, app: *App) !void {
break :window window;
}
};
errdefer c.gtk_window_destroy(@ptrCast(window));

const gtk_window: *c.GtkWindow = @ptrCast(window);
errdefer if (self.isAdwWindow()) {
c.adw_application_window_destroy(window);
} else {
c.gtk_application_window_destroy(gtk_window);
};
self.window = gtk_window;
c.gtk_window_set_title(gtk_window, "Ghostty");
c.gtk_window_set_default_size(gtk_window, 1000, 600);
Expand Down

0 comments on commit 6d8cf55

Please sign in to comment.