diff options
author | David Robillard <d@drobilla.net> | 2016-12-14 15:00:15 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2016-12-14 15:00:15 -0500 |
commit | ab1e90c6374d5a06e7b77821728c57b9bb391afe (patch) | |
tree | 566fbf8ab3a830141363d7a135e2f97f7def53a9 | |
parent | de5c98fa932ced16291eb5c3489a0e745a248ec4 (diff) | |
download | patchage-ab1e90c6374d5a06e7b77821728c57b9bb391afe.tar.gz patchage-ab1e90c6374d5a06e7b77821728c57b9bb391afe.tar.bz2 patchage-ab1e90c6374d5a06e7b77821728c57b9bb391afe.zip |
Fix potential infinite loop
-rw-r--r-- | src/Patchage.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Patchage.cpp b/src/Patchage.cpp index b9386cb..eae2ef9 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -479,6 +479,13 @@ Patchage::idle_callback() void Patchage::update_toolbar() { + static bool updating = false; + if (updating) { + return; + } else { + updating = true; + } + #if defined(PATCHAGE_LIBJACK) || defined(HAVE_JACK_DBUS) if (_jack_driver->is_attached()) { const jack_nframes_t buffer_size = _jack_driver->buffer_size(); @@ -491,11 +498,13 @@ Patchage::update_toolbar() _latency_label->set_label(ss.str()); _latency_label->set_visible(true); _buf_size_combo->set_active((int)log2f(_jack_driver->buffer_size()) - 5); + updating = false; return; } } #endif _latency_label->set_visible(false); + updating = false; } bool |