Merge "Clean up local hprofs" am: 9ab94e15c7

am: 1876d82450

Change-Id: I16c2e27c21d933e6090adb48af144c731a2c8ac6
This commit is contained in:
Michael Rosenfeld
2016-12-18 00:21:19 +00:00
committed by android-build-merger

View File

@@ -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();
}
}
}