Add option :exit-on-close for defapplet. If :exit-onclose equal 'false' then (Systen/exit 0) not called for :on-close event.