Send figma.on('close') to plugin when closing Figma document while plugin open

Send a figma.on('close') message to the current plugin when the Figma document is closed while the plugin inside it is open.

Without this it’s impossible to properly clean up after the plugin in all cases, because when I reopen the document, it still contains my plugin’s helper objects that should have been cleaned up.

Hey there, thank you for the feedback!

We’ll pass this onto our team for consideration.