Add missing cancel callback for delayed call.
And make the function a little neater.
This commit is contained in:
@ -1013,23 +1013,19 @@ bool Worker::cancel_delayed_call(uint32_t id)
|
|||||||
// Not particularly likely there will be many of those.
|
// Not particularly likely there will be many of those.
|
||||||
auto range = m_sorted_calls.equal_range(pCall->at());
|
auto range = m_sorted_calls.equal_range(pCall->at());
|
||||||
|
|
||||||
auto k = range.first;
|
mxb_assert(range.first != range.second);
|
||||||
mxb_assert(k != range.second);
|
|
||||||
|
|
||||||
while (k != range.second)
|
for (auto k = range.first; k != range.second; ++k)
|
||||||
{
|
{
|
||||||
if (k->second == pCall)
|
if (k->second == pCall)
|
||||||
{
|
{
|
||||||
m_sorted_calls.erase(k);
|
m_sorted_calls.erase(k);
|
||||||
|
|
||||||
|
pCall->call(Worker::Call::CANCEL);
|
||||||
delete pCall;
|
delete pCall;
|
||||||
|
|
||||||
k = range.second;
|
|
||||||
|
|
||||||
found = true;
|
found = true;
|
||||||
}
|
break;
|
||||||
else
|
|
||||||
{
|
|
||||||
++k;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user