Index: src/platform-macos.cc |
diff --git a/src/platform-macos.cc b/src/platform-macos.cc |
index 551690989fd3057a14594fbbd06b141bcef0bd45..14207b0a6ac565fac769cf3f331cb9de80a561ff 100644 |
--- a/src/platform-macos.cc |
+++ b/src/platform-macos.cc |
@@ -283,13 +283,12 @@ int OS::StackWalk(Vector<StackFrame> frames) { |
return 0; |
int frames_size = frames.length(); |
- void** addresses = NewArray<void*>(frames_size); |
- int frames_count = backtrace(addresses, frames_size); |
+ ScopedVector<void*> addresses(frames_size); |
- char** symbols; |
- symbols = backtrace_symbols(addresses, frames_count); |
+ int frames_count = backtrace(addresses.start(), frames_size.start()); |
+ |
+ char** symbols = backtrace_symbols(addresses.start(), frames_count); |
if (symbols == NULL) { |
- DeleteArray(addresses); |
return kStackWalkError; |
} |
@@ -305,7 +304,6 @@ int OS::StackWalk(Vector<StackFrame> frames) { |
frames[i].text[kStackWalkMaxTextLen - 1] = '\0'; |
} |
- DeleteArray(addresses); |
free(symbols); |
return frames_count; |