How to gracefully handle failed function call to call_every() in EventQueue?


In API documentation, it is stated that call to the following function of EventQueue can fail due to lack of memory.

int call_every 	( 	int  	ms,
		F  	f,
		Args...  	args 

In long term testing, this rarely but does happen under certain circumstances. My question is, how do we gracefully handle such situation?

I assume the lack of memory means EventQueue’s parent thread, and is caused by accumulated delayed events. There is another member function:

void break_dispatch( ) 

Will call this function cancel all pending events, then release memory these events used?

Please advise, thanks.