File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,13 @@ export default function Internal({
157157 object_root [ prop_name ] = new_value ;
158158 }
159159 }
160+
161+ // Toplevel windows returned by these functions will stay around
162+ // until the user explicitly destroys them with gtk_window_destroy().
163+ // https://docs.gtk.org/gtk4/class.Builder.html
164+ if ( object_preview instanceof Gtk . Window ) {
165+ object_preview . destroy ( ) ;
166+ }
160167 }
161168
162169 if ( ! object_root . name ) {
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ namespace Workbench {
4242 var target = this . builder. get_object (target_id) as Gtk . Widget ;
4343 if (target == null ) {
4444 stderr. printf (@" Widget with target_id='$target_id ' could not be found.\n " );
45- return ;
45+ return ;
4646 }
4747
4848 if (original_id != " " ) {
@@ -75,6 +75,13 @@ namespace Workbench {
7575 ((Gtk . Window ) target). child = null ;
7676 this . window. child = child;
7777 }
78+
79+ // Toplevel windows returned by these functions will stay around
80+ // until the user explicitly destroys them with gtk_window_destroy().
81+ // https://docs.gtk.org/gtk4/class.Builder.html
82+ if (target is Gtk . Window ) {
83+ ((Gtk . Window ) target). destroy();
84+ }
7885 }
7986
8087 public void update_css (string content) {
You can’t perform that action at this time.
0 commit comments