mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 07:46:12 +03:00
gtk: fix crash due to accessing invalidated pointer to adwaita notebook
This commit is contained in:
@ -125,7 +125,10 @@ pub const NotebookAdw = struct {
|
|||||||
// as true so that the close_page call below doesn't request
|
// as true so that the close_page call below doesn't request
|
||||||
// confirmation.
|
// confirmation.
|
||||||
self.forcing_close = true;
|
self.forcing_close = true;
|
||||||
defer self.forcing_close = false;
|
const n = self.nPages();
|
||||||
|
defer {
|
||||||
|
if (n > 1) self.forcing_close = false;
|
||||||
|
}
|
||||||
|
|
||||||
const page = c.adw_tab_view_get_page(self.tab_view, @ptrCast(tab.box)) orelse return;
|
const page = c.adw_tab_view_get_page(self.tab_view, @ptrCast(tab.box)) orelse return;
|
||||||
c.adw_tab_view_close_page(self.tab_view, page);
|
c.adw_tab_view_close_page(self.tab_view, page);
|
||||||
|
Reference in New Issue
Block a user