Skip to content

Commit

Permalink
webOS: Fix allocateTimerId
Browse files Browse the repository at this point in the history
Change-Id: I8b3777f4035401763d86b0245de43b63573b9ea6
Reviewed-by: Thiago Macieira <[email protected]>
Reviewed-by: Mårten Nordheim <[email protected]>
(cherry picked from commit 4683b0b)
  • Loading branch information
Jani Hautakangas authored and Gagi2k committed Jun 4, 2020
1 parent 25f2f41 commit a288ff8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/corelib/kernel/qabstracteventdispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,14 @@ Q_GLOBAL_STATIC(QtTimerIdFreeList, timerIdFreeList)

int QAbstractEventDispatcherPrivate::allocateTimerId()
{
return timerIdFreeList()->next();
// This function may be called after timerIdFreeList() has been destructed
// for example in case when application exits without waiting for
// running threads to exit and running thread finished() has been connected
// to a slot which triggers a sequence that registers new timer.
// See https://bugreports.qt-project.org/browse/QTBUG-38957.
if (QtTimerIdFreeList *fl = timerIdFreeList())
return fl->next();
return 0; // Note! returning 0 generates a warning
}

void QAbstractEventDispatcherPrivate::releaseTimerId(int timerId)
Expand Down

0 comments on commit a288ff8

Please sign in to comment.