If you have some things that you do on creation/initialization, that you would like to NOT do when being scanned, is there anyway to determine this?
What I’ve done for now to prevent code from being executed while being scanned is to wrap the code in Timer::callAfterDelay
which will apparently not be executed while scanning since the object is deleted before it can execute…
Timer::callAfterDelay (100, [this] {
{
// code here will not be executed while scanning
}
});
But is there a better way?