fix Timer

use after free
This commit is contained in:
Michael Davidsaver
2018-06-19 16:32:39 -07:00
parent 57e57d9e43
commit a1c0e432ee
+1 -2
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;
}
}