fix Timer

use after free
This commit is contained in:
Michael Davidsaver
2018-06-14 10:09:46 -05:00
parent 57e57d9e43
commit a1c0e432ee

View File

@@ -64,9 +64,8 @@ bool Timer::cancel(TimerCallbackPtr const &timerCallback)
{
TimerCallbackPtr& cur = *it;
if(cur.get() == timerCallback.get()) {
queue.erase(it);
cur->onList = false;
// iteration now invalid
queue.erase(it); // invalidates cur and it
return true;
}
}