File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -453,12 +453,19 @@ public class MainWindow : Adw.ApplicationWindow {
453453 if (project_view != null ) {
454454 if (views_stack. visible_child == project_view) {
455455 go_homepage ();
456+ // Use a timeout to ensure the view transition is complete before cleanup
457+ GLib . Timeout . add (views_stack. transition_duration, () = > {
458+ project_view. clean_up ();
459+ project_view. destroy ();
460+ views_stack. remove (project_view);
461+ return GLib . Source . REMOVE ;
462+ });
463+ } else {
464+ // If not visible, we can clean up immediately
465+ project_view. clean_up ();
466+ project_view. destroy ();
467+ views_stack. remove (project_view);
456468 }
457-
458- project_view. clean_up ();
459- project_view. destroy ();
460-
461- views_stack. remove (project_view);
462469 }
463470 }
464471
You can’t perform that action at this time.
0 commit comments