As you suggested, I called the accept() slot after the purgeCache function is completed.

However, the form does not close.