addon is saving info to userdata folder?

So I am not sure what I need or need to add as I can on figure out with something already working…

But I have a add-on that is saving images to the userdata folder..
Is there something I can add to the script to clear folder when Kodi is closed?

Or delete the whole folder?