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.