title: Java applet: How to make sure destroy is finished before page refresh
body: <p>In Java util logging, I initiate the handler on init(), and close the handler at destroy() and it works perfectly fine: A log file was created, etc. If the user refreshs the page normally, it still just creates one log file.</p>
  
  <p>However if the user refreshs the page with the applet a couple of times fast, it seems like the destroy() does not get called or maybe hasn't finished the task and since the init() gets called again, it assumes the previous file is still locked and creates a new log file.</p>
  
  <p>I tried to use both destroy() and finalize() to close the handler but it does not work.
  Anyone has any idea how to solve this issue?</p>
  
  <p>Another minor question is: What actually happened if init() has not finished and the page gets refreshed. Is it going to continue the process and eventually failes to call destroy() or does it just stop right there?</p>