summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-12-14 15:00:15 -0500
committerDavid Robillard <d@drobilla.net>2016-12-14 15:00:15 -0500
commitab1e90c6374d5a06e7b77821728c57b9bb391afe (patch)
tree566fbf8ab3a830141363d7a135e2f97f7def53a9 /src
parentde5c98fa932ced16291eb5c3489a0e745a248ec4 (diff)
downloadpatchage-ab1e90c6374d5a06e7b77821728c57b9bb391afe.tar.gz
patchage-ab1e90c6374d5a06e7b77821728c57b9bb391afe.tar.bz2
patchage-ab1e90c6374d5a06e7b77821728c57b9bb391afe.zip
Fix potential infinite loop
Diffstat (limited to 'src')
-rw-r--r--src/Patchage.cpp9
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