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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user