diff options
| author | 2016-12-17 01:54:34 +0000 | |
|---|---|---|
| committer | 2016-12-17 01:54:34 +0000 | |
| commit | 9ab94e15c756d88fa9e771896e1d5fd55f24e206 (patch) | |
| tree | be074a3eea365749089a5b77a26e2d3ac989e7ef | |
| parent | e2c22e38d522641e0b321ef334c8803f5dc7c08f (diff) | |
| parent | 2b62809c70555b76726bee812b5b962addb31606 (diff) | |
Merge "Clean up local hprofs"
| -rw-r--r-- | tools/preload2/src/com/android/preload/classdataretrieval/hprof/Hprof.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/preload2/src/com/android/preload/classdataretrieval/hprof/Hprof.java b/tools/preload2/src/com/android/preload/classdataretrieval/hprof/Hprof.java index 21b7a04e07dc..84ec8b7d0fdd 100644 --- a/tools/preload2/src/com/android/preload/classdataretrieval/hprof/Hprof.java +++ b/tools/preload2/src/com/android/preload/classdataretrieval/hprof/Hprof.java @@ -171,6 +171,9 @@ public class Hprof implements ClassDataRetriever { arg1.getDevice().getSyncService().pullFile(arg0, target.getAbsoluteFile().toString(), new NullProgressMonitor()); } catch (Exception e) { + if (target != null) { + target.delete(); + } e.printStackTrace(); target = null; } @@ -189,6 +192,9 @@ public class Hprof implements ClassDataRetriever { out.write(arg0); out.close(); } catch (Exception e) { + if (target != null) { + target.delete(); + } e.printStackTrace(); target = null; } @@ -215,6 +221,8 @@ public class Hprof implements ClassDataRetriever { return analyzeHprof(hprofLocalFile); } catch (Exception e) { throw new RuntimeException(e); + } finally { + hprofLocalFile.delete(); } } } |