widget/hintbox.cpp/h: use disconnect instead check for OnTimer

diconnect ensures handle of current slot.
This commit is contained in:
2018-12-23 22:56:16 +01:00
parent 25d55b60b9
commit cb40dcb9ea
2 changed files with 4 additions and 2 deletions

View File

@@ -198,8 +198,9 @@ void CHintBox::enableTimeOutBar(bool enable)
const string tn = cc_item_type.name + ":timeout_bar:";
timeout_pb_timer->setThreadName(tn);
}
if (timeout_pb_timer->OnTimer.empty())
timeout_pb_timer->OnTimer.connect(sigc::mem_fun0(this, &CHintBox::showTimeOutBar));
sl_tbar_on_timer.disconnect();
sl_tbar_on_timer = sigc::mem_fun0(this, &CHintBox::showTimeOutBar);
timeout_pb_timer->OnTimer.connect(sl_tbar_on_timer);
timeout_pb_timer->startTimer();
}
}

View File

@@ -62,6 +62,7 @@ class CHintBox : public CComponentsWindow
int h_hint_obj;
int w_indentation;
bool enable_txt_scroll;
sigc::slot0<void> sl_tbar_on_timer;
Font* hb_font;