From d4fb223045fb9fd3b999b59bb4b96db7f279fef3 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 15 Sep 2018 22:48:29 +0200 Subject: [PATCH] src/gui/widget/hintbox.cpp: connect OnTimer slot only if is still empty Prevent multiple connections to slot. Only to be sure. --- src/gui/widget/hintbox.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 88dac0fda..677381d6a 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -194,9 +194,10 @@ void CHintBox::enableTimeOutBar(bool enable) timeout_pb->setValues(0, 100*timeout); if (!timeout_pb_timer) { timeout_pb_timer = new CComponentsTimer(1, true); - timeout_pb_timer->setThreadName("hb:tmoutbar"); + timeout_pb_timer->setThreadName("hb:timeoutbar"); } - timeout_pb_timer->OnTimer.connect(sigc::mem_fun0(this, &CHintBox::showTimeOutBar)); + if (timeout_pb_timer->OnTimer.empty()) + timeout_pb_timer->OnTimer.connect(sigc::mem_fun0(this, &CHintBox::showTimeOutBar)); timeout_pb_timer->startTimer(); } }