totally not hacky way of detecting duplicate step callbacks

This commit is contained in:
mrexodia 2015-12-20 07:12:42 +01:00
parent 841a99b5ee
commit a006043c26
2 changed files with 11 additions and 0 deletions

View File

@ -76,6 +76,16 @@ namespace GleeBug
void ThreadInfo::StepInto(const StepCallback & cbStep)
{
StepInto();
auto target = cbStep.target<void()>();
for (const auto & cb : stepCallbacks)
{
if (target == cb.target<void()>())
{
puts("duplicate StepInto callback detected!");
return;
}
}
stepCallbacks.push_back(cbStep);
}

View File

@ -5,6 +5,7 @@
#include <string>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>
#include <functional>