Add file name to temp file at write to disk

This commit is contained in:
chimp1984 2020-10-16 13:27:21 -05:00
parent 6b4d77fb1b
commit 0b38fccfd2
No known key found for this signature in database
GPG Key ID: 9801B4EC591F90E3

View File

@ -305,7 +305,7 @@ public class PersistenceManager<T extends PersistableEnvelope> {
tempFile = usedTempFilePath != null
? FileUtil.createNewFile(usedTempFilePath)
: File.createTempFile("temp", null, dir);
: File.createTempFile("temp_" + fileName, null, dir);
// Don't use a new temp file path each time, as that causes the delete-on-exit hook to leak memory:
tempFile.deleteOnExit();