From 959eb60ad08e9dc7450d56da735abf001ef48be2 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sun, 28 Dec 2014 16:19:55 +0100 Subject: [PATCH] Scoping error caused the Unsaved Changes dialog not to be shown when closing the main window --- lib/Slic3r/GUI/MainFrame.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Slic3r/GUI/MainFrame.pm b/lib/Slic3r/GUI/MainFrame.pm index 31b9ff0a3d..4cd4db7066 100644 --- a/lib/Slic3r/GUI/MainFrame.pm +++ b/lib/Slic3r/GUI/MainFrame.pm @@ -673,7 +673,11 @@ sub config { sub check_unsaved_changes { my $self = shift; - my @dirty = map $_->title, grep $_->is_dirty, values %{$self->{options_tabs}}; + my @dirty = (); + foreach my $tab (values %{$self->{options_tabs}}) { + push @dirty, $tab->title if $tab->is_dirty; + } + if (@dirty) { my $titles = join ', ', @dirty; my $confirm = Wx::MessageDialog->new($self, "You have unsaved changes ($titles). Discard changes and continue anyway?",