Listening to definition close event

Hi all,

Someone else has asked this question before here but there was no reply, so I thought I was going to ask it again: is there a way to listen to the event when a Dynamo definition is closed, or when a new Dynamo definition is opened? I am keeping a list of data in my Zero Touch DLL and would like it to be cleared when a new file is opened.

Many thanks,