Skip to content

Commit 851799e

Browse files
committed
app/notebook: work around Gtk 4 memory leak
1 parent 6f4506e commit 851799e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ddterm/app/notebook.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ export const Notebook = GObject.registerClass({
320320
}),
321321
];
322322

323-
const label = this.get_tab_label(child);
323+
const label = child.tab_label;
324324
const page = this.get_page(child);
325325

326326
const bindings = [
@@ -403,7 +403,9 @@ export const Notebook = GObject.registerClass({
403403
command: properties['command'] ?? this.get_command_from_settings(),
404404
});
405405

406-
this.insert_page(page, page.tab_label, position);
406+
this.insert_page(page, null, position);
407+
this.set_tab_label(page, page.tab_label);
408+
407409
return page;
408410
}
409411

@@ -418,7 +420,7 @@ export const Notebook = GObject.registerClass({
418420
const n_pages = this.get_n_pages();
419421

420422
for (let i = 0; i < n_pages; i++) {
421-
const label = this.get_tab_label(this.get_nth_page(i));
423+
const label = this.get_nth_page(i).tab_label;
422424

423425
label.action_target = GLib.Variant.new_int32(i);
424426
label.action_name = 'notebook.switch-to-tab';

0 commit comments

Comments
 (0)