diff options
| author | 2016-12-18 00:28:42 +0000 | |
|---|---|---|
| committer | 2016-12-18 00:28:42 +0000 | |
| commit | bf5546b1e2c5c067a4c63aaf1c4714ba727a33ca (patch) | |
| tree | a39876792566513b4b3ddae3e2d21096d4bf977e | |
| parent | 02daba1e72c35fd998fd0fda3fbecb6a1dc543a7 (diff) | |
| parent | 67fd9f3968f5270415bee35c9d2e40477a5a79c3 (diff) | |
Merge "Clean up local hprofs" am: 9ab94e15c7 am: 1876d82450
am: 67fd9f3968
Change-Id: I8eaea581cfda4844c3ea81f7ee63f0cfc40ef3e0
| -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(); } } } |