qcam: Stop timer on timeout
Stopping the timer will reset the Timer::deadline_ field to 0 fixing potential bugs and call QtEventDispatcher::unregisterTimer() which will take care of the cleanup. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
b13b134616
commit
82bf40e1f0
1 changed files with 2 additions and 4 deletions
|
@ -130,10 +130,8 @@ void QtEventDispatcher::unregisterTimer(Timer *timer)
|
|||
|
||||
void QtEventDispatcher::timerEvent(QTimerEvent *event)
|
||||
{
|
||||
auto it = timers_.find(event->timerId());
|
||||
timerIds_.erase(it->second);
|
||||
killTimer(it->first);
|
||||
timers_.erase(it);
|
||||
Timer *timer = timers_[event->timerId()];
|
||||
timer->stop();
|
||||
}
|
||||
|
||||
void QtEventDispatcher::processEvents()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue