Skip to content

Commit

Permalink
fixed TimerManager 在未 start 之前加入定时器时出现重复的定时器
Browse files Browse the repository at this point in the history
  • Loading branch information
fasiondog committed May 18, 2022
1 parent 45f8ebc commit 459a7d6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hikyuu_cpp/hikyuu/utilities/TimerManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ class TimerManager {

/** 启动调度, 可在停止后重新启动 */
void start() {
std::priority_queue<IntervalS> new_queue;
m_queue.swap(new_queue);
if (m_stop) {
m_stop = false;
if (!m_tg) {
Expand Down Expand Up @@ -348,7 +350,7 @@ class TimerManager {
s.m_time_point > today + timer->m_end_time) {
s.m_time_point = today + timer->m_start_time + TimeDelta(1);
}
HKU_TRACE("s.m_time_point: {}", s.m_time_point.repr());
// HKU_TRACE("s.m_time_point: {}", s.m_time_point.repr());
m_queue.push(s);
}
}
Expand Down

0 comments on commit 459a7d6

Please sign in to comment.