This commit is contained in:
Maxime Leroy 2025-08-22 16:36:12 +08:00 committed by GitHub
commit 6202018b7a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -256,9 +256,20 @@ namespace SourceHook
ICleanupTask *m_CleanupTask;
bool isValidIterator(List<CHook>::iterator &myIter, List<CHook> &myList) {
for (auto iter = myList.begin(); iter != myList.end(); ++iter) {
if (iter == myIter) {
return true;
}
}
return false;
}
void SkipPaused(List<CHook>::iterator &iter, List<CHook> &list)
{
while (iter != list.end() && iter->IsPaused())
if (!iter || !isValidIterator(iter, list))
iter = list.end();
while (iter != list.end() && iter && iter->IsPaused())
++iter;
}
public: