From 9cd28821902e8f0c86d6ef80cc21ede8daa1e4dd Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 28 Jul 2004 07:38:25 +0000 Subject: [PATCH] Score one for the JarDiffPatcher and Windows. JarDiffPatcher doesn't properly close its files, so Windows prevents us from deleting them. Yay! Hopefully if we queue them up for deletion on exit, the finalizers will all have been run and JarDiffPatcher's mess will be cleaned up and they'll get deleted. --- src/java/com/threerings/getdown/tools/Patcher.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/java/com/threerings/getdown/tools/Patcher.java b/src/java/com/threerings/getdown/tools/Patcher.java index ccb4eb6..f60918c 100644 --- a/src/java/com/threerings/getdown/tools/Patcher.java +++ b/src/java/com/threerings/getdown/tools/Patcher.java @@ -1,5 +1,5 @@ // -// $Id: Patcher.java,v 1.2 2004/07/14 13:44:49 mdb Exp $ +// $Id: Patcher.java,v 1.3 2004/07/28 07:38:25 mdb Exp $ package com.threerings.getdown.tools; @@ -166,8 +166,12 @@ public class Patcher StreamUtil.close(fout); StreamUtil.close(in); // clean up our temporary files - patch.delete(); - otarget.delete(); + if (!patch.delete()) { + patch.deleteOnExit(); + } + if (!otarget.delete()) { + otarget.deleteOnExit(); + } } }