suspend timers while flushing the gtk-event queue.

This fixes an issues where Ardour never completes to flush the GUI event
queue due to rapid updates for meters and similar events.

ARDOUR_UI::load_session() never returned and the complete session
ran inside Gtkmm2ext::UI::flush_pending(), this later causes a crash
at exit.

as side effect, this also speeds up session load.
This commit is contained in:
Robin Gareus 2015-10-30 15:54:54 +01:00
parent 4fa564c03b
commit 4a3413f2d4
3 changed files with 8 additions and 1 deletions

View File

@ -3204,7 +3204,10 @@ ARDOUR_UI::load_session (const std::string& path, const std::string& snap_name,
fst_stop_threading(); fst_stop_threading();
#endif #endif
flush_pending (); {
Timers::TimerSuspender t;
flush_pending ();
}
#ifdef WINDOWS_VST_SUPPORT #ifdef WINDOWS_VST_SUPPORT
fst_start_threading(); fst_start_threading();

View File

@ -5074,6 +5074,7 @@ Editor::first_idle ()
MessageDialog* dialog = 0; MessageDialog* dialog = 0;
if (track_views.size() > 1) { if (track_views.size() > 1) {
Timers::TimerSuspender t;
dialog = new MessageDialog ( dialog = new MessageDialog (
*this, *this,
string_compose (_("Please wait while %1 loads visual data."), PROGRAM_NAME), string_compose (_("Please wait while %1 loads visual data."), PROGRAM_NAME),

View File

@ -96,6 +96,7 @@
#include "streamview.h" #include "streamview.h"
#include "strip_silence_dialog.h" #include "strip_silence_dialog.h"
#include "time_axis_view.h" #include "time_axis_view.h"
#include "timers.h"
#include "transpose_dialog.h" #include "transpose_dialog.h"
#include "transform_dialog.h" #include "transform_dialog.h"
#include "ui_config.h" #include "ui_config.h"
@ -7887,6 +7888,7 @@ Editor::bring_in_callback (Gtk::Label* label, uint32_t n, uint32_t total, string
void void
Editor::update_bring_in_message (Gtk::Label* label, uint32_t n, uint32_t total, string name) Editor::update_bring_in_message (Gtk::Label* label, uint32_t n, uint32_t total, string name)
{ {
Timers::TimerSuspender t;
label->set_text (string_compose ("Copying %1, %2 of %3", name, n, total)); label->set_text (string_compose ("Copying %1, %2 of %3", name, n, total));
Gtkmm2ext::UI::instance()->flush_pending (); Gtkmm2ext::UI::instance()->flush_pending ();
} }
@ -7907,6 +7909,7 @@ Editor::bring_all_sources_into_session ()
* files * files
*/ */
Timers::TimerSuspender t;
Gtkmm2ext::UI::instance()->flush_pending (); Gtkmm2ext::UI::instance()->flush_pending ();
cerr << " Do it\n"; cerr << " Do it\n";