Fix crash when users close plot windows, re #8091
Merge branch 'feature/8091_control_spawning_of_plot_windows' into develop