Asynchronously ask for saving when plugin is unloaded

Hi,

I’m updating a plugin to replace all modal requests with asynchronous ones and am wondering how to handle a last “File has been updated. Do you wish to save?” with the subsequent saving, when the plugin is being unloaded by the host.

Any suggestion?

Best wishes,

Mariano