Properly removing a window
This commit is contained in:
parent
f614e9774f
commit
bae36631d2
1 changed files with 3 additions and 3 deletions
|
|
@ -16,6 +16,7 @@ namespace gui_to_app {
|
||||||
namespace views = std::views;
|
namespace views = std::views;
|
||||||
|
|
||||||
AppWin2Back::AppWin2Back() : Gtk::Application("org.billy_adventures.character_sheet", Flags::HANDLES_OPEN) {
|
AppWin2Back::AppWin2Back() : Gtk::Application("org.billy_adventures.character_sheet", Flags::HANDLES_OPEN) {
|
||||||
|
signal_window_removed().connect([](const Gtk::Window *window) { delete window; });
|
||||||
Glib::set_application_name("Billy's character sheet");
|
Glib::set_application_name("Billy's character sheet");
|
||||||
selection_buttons.reserve(signal_handlers.size());
|
selection_buttons.reserve(signal_handlers.size());
|
||||||
}
|
}
|
||||||
|
|
@ -215,9 +216,8 @@ namespace gui_to_app {
|
||||||
|
|
||||||
void AppWin2Back::on_quit() noexcept {
|
void AppWin2Back::on_quit() noexcept {
|
||||||
ranges::for_each(get_windows() | views::filter([](const auto windows) { return windows != nullptr; }),
|
ranges::for_each(get_windows() | views::filter([](const auto windows) { return windows != nullptr; }),
|
||||||
[](auto *window) {
|
[this](auto *window) {
|
||||||
window->set_visible(false);
|
remove_window(*window);
|
||||||
delete window;
|
|
||||||
});
|
});
|
||||||
quit();
|
quit();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue