am ab8f73a7: am 497cb6c0: Merge "Avoid creating Caches instance with gfxinfo dump" into lmp-mr1-dev
* commit 'ab8f73a7f17d07bdb4ccb3b6971d3ddc8534bd7d':
Avoid creating Caches instance with gfxinfo dump
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp
index 254492f..70ff6e5 100644
--- a/libs/hwui/RenderNode.cpp
+++ b/libs/hwui/RenderNode.cpp
@@ -50,10 +50,13 @@
fprintf(file, "\nRecent DisplayList operations\n");
logBuffer.outputCommands(file);
- String8 cachesLog;
- Caches::getInstance().dumpMemoryUsage(cachesLog);
- fprintf(file, "\nCaches:\n%s", cachesLog.string());
- fprintf(file, "\n");
+ if (Caches::hasInstance()) {
+ String8 cachesLog;
+ Caches::getInstance().dumpMemoryUsage(cachesLog);
+ fprintf(file, "\nCaches:\n%s\n", cachesLog.string());
+ } else {
+ fprintf(file, "\nNo caches instance.\n");
+ }
fflush(file);
}