summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/RenderThread.cpp
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2018-06-26 11:41:34 -0700
committerJosh Gao <jmgao@google.com>2018-06-26 12:37:42 -0700
commit1c300861d2f0c12ac9aa8d36390e90b81fb8003b (patch)
treead7f287c666b62f848b852d5c07f7b4949bfc8a2 /libs/hwui/renderthread/RenderThread.cpp
parent6bebb8418ceecf44d2af40033870f3aabacfe36e (diff)
Fix memory leak in RenderThread::dumpGraphicsMemory.
This would have been a double-close of fd, except we just leak the FILE* instead. Test: treehugger Change-Id: I519366fbcf0eb6f03f79c22abfa2b1b1b493a70a
Diffstat (limited to 'libs/hwui/renderthread/RenderThread.cpp')
-rw-r--r--libs/hwui/renderthread/RenderThread.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp
index 72a428f1c70c..bd34eb80dee8 100644
--- a/libs/hwui/renderthread/RenderThread.cpp
+++ b/libs/hwui/renderthread/RenderThread.cpp
@@ -236,10 +236,8 @@ void RenderThread::dumpGraphicsMemory(int fd) {
break;
}
- FILE *file = fdopen(fd, "a");
- fprintf(file, "\n%s\n", cachesOutput.string());
- fprintf(file, "\nPipeline=%s\n", pipeline.string());
- fflush(file);
+ dprintf(fd, "\n%s\n", cachesOutput.string());
+ dprintf(fd, "\nPipeline=%s\n", pipeline.string());
}
Readback& RenderThread::readback() {