diff options
author | kkinnunen <kkinnunen@nvidia.com> | 2014-12-30 07:22:58 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-30 07:22:58 -0800 |
commit | 5037e9de94e57d36592cc596d831cc2b5ec45bd3 (patch) | |
tree | 816d7c02cb2d4640e2d4565b7c799ed86045ed17 /platform_tools | |
parent | d5e98713576a961d05b957465e83cdf992daca1b (diff) |
Change DebugCanvas API to not encourage memory leaks
Pass command strings and offset arrays as out parameters instead of
returning new arrays from the functions.
This simplifies debugger leak investigations, as the app leaks less by
design.
Review URL: https://codereview.chromium.org/821663003
Diffstat (limited to 'platform_tools')
-rw-r--r-- | platform_tools/nacl/src/nacl_debugger.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/platform_tools/nacl/src/nacl_debugger.cpp b/platform_tools/nacl/src/nacl_debugger.cpp index b80dde0938..e7e26b8129 100644 --- a/platform_tools/nacl/src/nacl_debugger.cpp +++ b/platform_tools/nacl/src/nacl_debugger.cpp @@ -76,11 +76,10 @@ public: picture->unref(); // Set up the command list. - SkTArray<SkString>* commands = fDebugger.getDrawCommandsAsStrings(); PostMessage("ClearCommands"); - for (int i = 0; i < commands->count(); ++i) { + for (int i = 0; i < fDebugger.getSize(); ++i) { SkString addCommand("AddCommand:"); - addCommand.append((*commands)[i]); + addCommand.append(fDebugger.getDrawCommandAt(i)->toString()); PostMessage(addCommand.c_str()); } PostMessage("UpdateCommands"); |