qcam: Fix unregister of not registered timer
If an unregistered timer is given to QtEventDispatcher::unregisterTimer() an error is printed and Qt gets confused and locks up. Fix this by following the libcamera documentation that passing a unregistered timer is a no-op. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
@@ -120,6 +120,9 @@ void QtEventDispatcher::registerTimer(Timer *timer)
|
||||
void QtEventDispatcher::unregisterTimer(Timer *timer)
|
||||
{
|
||||
auto it = timerIds_.find(timer);
|
||||
if (it == timerIds_.end())
|
||||
return;
|
||||
|
||||
timers_.erase(it->second);
|
||||
killTimer(it->second);
|
||||
timerIds_.erase(it);
|
||||
|
||||
Reference in New Issue
Block a user