From e8ea0548e0817044c013aa778aa810f4e028c8c3 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 6 Mar 2017 15:07:19 +0100 Subject: [PATCH] Fix save-as progress dialog. ScopedConnection and label,bar went out of scope. --- gtk2_ardour/ardour_ui.cc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 38fceffdd8..10d637d2e9 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -2705,16 +2705,17 @@ ARDOUR_UI::save_session_as () */ ArdourDialog progress_dialog (_("Save As"), true); + ScopedConnection c; if (sa.include_media && sa.copy_media) { - Gtk::Label label; - Gtk::ProgressBar progress_bar; + Gtk::Label* label = manage (new Gtk::Label()); + Gtk::ProgressBar* progress_bar = manage (new Gtk::ProgressBar ()); - progress_dialog.get_vbox()->pack_start (label); - progress_dialog.get_vbox()->pack_start (progress_bar); - label.show (); - progress_bar.show (); + progress_dialog.get_vbox()->pack_start (*label); + progress_dialog.get_vbox()->pack_start (*progress_bar); + label->show (); + progress_bar->show (); /* this signal will be emitted from within this, the calling thread, * after every file is copied. It provides information on percentage @@ -2722,9 +2723,7 @@ ARDOUR_UI::save_session_as () * copied so far, and the total number to copy. */ - ScopedConnection c; - - sa.Progress.connect_same_thread (c, boost::bind (&ARDOUR_UI::save_as_progress_update, this, _1, _2, _3, &label, &progress_bar)); + sa.Progress.connect_same_thread (c, boost::bind (&ARDOUR_UI::save_as_progress_update, this, _1, _2, _3, label, progress_bar)); progress_dialog.show_all (); progress_dialog.present ();