I create one task named thread2 using AsyncTaskExecuter from a function which is running in some thread as mentioned below.
create task thread2
// call RunModalLoop on alert window //this blocks func1 till above thread2 completes
theDialog.setContentComponent (&theDialogPane, true, true);
theDialog.centreAroundComponent (NULL, theDialog.getWidth(), theDialog.getHeight());
if (no error)
call exitmodalstate on alertwindow to signal func1 about completion of thread2
Now here I have one issue, in case of some error, thread2func() reaches execution of line call exitmodalstate but func1() has not reached to line theDialog.runModalLoop();
So when calling exitmodalstate, it throws unhandled exception.
I also tried like this, but then it does not close dialog window and dialog keeps running
if(component.getParentComponent() != NULL)
I get exception at below line "if (flags.currentlyModalFlag)" in exitmodalstate function
void Component::exitModalState (const int returnValue)
How to handle this exception