aggiunta gestione di chiusura finestra