summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/RenderThread.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2017-11-13 11:32:39 -0800
committerJohn Reck <jreck@google.com>2017-11-13 11:32:39 -0800
commit47f5c3a234c5c201ef640489af3ff25b5eec6652 (patch)
tree95308e88c2e4c19dd16030a4afe07603112ed8bc /libs/hwui/renderthread/RenderThread.cpp
parentae5eb83a32a2005bd2c872bdf7b0621190ddb062 (diff)
Fix leak of FILE* in dumping
Avoid fdopen as fclose, which frees the FILE*, will close the FD which we don't want. Just normalize on dprintf instead, and we can add buffering if it turns out to matter at some point Test: ran 'dumpsys gfxinfo framestats' in a loop while observing PSS Change-Id: I7808753641aa1055cfdf570c3e017017f11f1dee
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 574bb0212385..3e2eeee2bcf5 100644
--- a/libs/hwui/renderthread/RenderThread.cpp
+++ b/libs/hwui/renderthread/RenderThread.cpp
@@ -141,10 +141,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() {