fix possible 'close' event before all temp files are done
Release 2.1.5