i'm playing with some proprietary code which is quite in depth so unfortunately i can't post all of it but i think i've covered the main points:

class FeedHandler
{

public:

FeedHandler() : value_set(false);

// point of entry to start the feedhandler class
int run()
{
listener->start(); //see processEvent()
while (!value_set)
{
//keep looping
//Sleep(1000); //will not crash if i Sleep
}
listener->stop();
return 0;
}

//callback function to handle events from listener
virtual bool processEvent()
{
value_set = true;
}

protected:
bool value_set;
}


listener continually communicates with an external server and triggers an event when a desired value is returned. All I want to do is to keep run() going so listener can keep going until the event is triggered. However, the program sometimes crashes with a R6010 abort() error. Other times it runs fine.
If I Sleep in the while loop for a minimum of 1s it always runs fine but any less I get the same intermittent error.

Can someone please explain why I'm getting this error? All the R6010 errors I've googled have been about pointers or strings or accessing memory that's not meant to be.