1246f4068280b5b191303ff13671e43a0522987demmentovai// Copyright (c) 2006, Google Inc.
2246f4068280b5b191303ff13671e43a0522987demmentovai// All rights reserved.
3246f4068280b5b191303ff13671e43a0522987demmentovai//
4246f4068280b5b191303ff13671e43a0522987demmentovai// Redistribution and use in source and binary forms, with or without
5246f4068280b5b191303ff13671e43a0522987demmentovai// modification, are permitted provided that the following conditions are
6246f4068280b5b191303ff13671e43a0522987demmentovai// met:
7246f4068280b5b191303ff13671e43a0522987demmentovai//
8246f4068280b5b191303ff13671e43a0522987demmentovai//     * Redistributions of source code must retain the above copyright
9246f4068280b5b191303ff13671e43a0522987demmentovai// notice, this list of conditions and the following disclaimer.
10246f4068280b5b191303ff13671e43a0522987demmentovai//     * Redistributions in binary form must reproduce the above
11246f4068280b5b191303ff13671e43a0522987demmentovai// copyright notice, this list of conditions and the following disclaimer
12246f4068280b5b191303ff13671e43a0522987demmentovai// in the documentation and/or other materials provided with the
13246f4068280b5b191303ff13671e43a0522987demmentovai// distribution.
14246f4068280b5b191303ff13671e43a0522987demmentovai//     * Neither the name of Google Inc. nor the names of its
15246f4068280b5b191303ff13671e43a0522987demmentovai// contributors may be used to endorse or promote products derived from
16246f4068280b5b191303ff13671e43a0522987demmentovai// this software without specific prior written permission.
17246f4068280b5b191303ff13671e43a0522987demmentovai//
18246f4068280b5b191303ff13671e43a0522987demmentovai// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19246f4068280b5b191303ff13671e43a0522987demmentovai// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20246f4068280b5b191303ff13671e43a0522987demmentovai// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21246f4068280b5b191303ff13671e43a0522987demmentovai// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22246f4068280b5b191303ff13671e43a0522987demmentovai// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23246f4068280b5b191303ff13671e43a0522987demmentovai// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24246f4068280b5b191303ff13671e43a0522987demmentovai// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25246f4068280b5b191303ff13671e43a0522987demmentovai// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26246f4068280b5b191303ff13671e43a0522987demmentovai// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27246f4068280b5b191303ff13671e43a0522987demmentovai// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28246f4068280b5b191303ff13671e43a0522987demmentovai// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29246f4068280b5b191303ff13671e43a0522987demmentovai
30246f4068280b5b191303ff13671e43a0522987demmentovai// call_stack.cc: A call stack comprised of stack frames.
31246f4068280b5b191303ff13671e43a0522987demmentovai//
32246f4068280b5b191303ff13671e43a0522987demmentovai// See call_stack.h for documentation.
33246f4068280b5b191303ff13671e43a0522987demmentovai//
34246f4068280b5b191303ff13671e43a0522987demmentovai// Author: Mark Mentovai
35246f4068280b5b191303ff13671e43a0522987demmentovai
36e5dc60822e5938fea2ae892ccddb906641ba174emmentovai#include "google_breakpad/processor/call_stack.h"
37e5dc60822e5938fea2ae892ccddb906641ba174emmentovai#include "google_breakpad/processor/stack_frame.h"
38246f4068280b5b191303ff13671e43a0522987demmentovai
39e5dc60822e5938fea2ae892ccddb906641ba174emmentovainamespace google_breakpad {
40246f4068280b5b191303ff13671e43a0522987demmentovai
41246f4068280b5b191303ff13671e43a0522987demmentovaiCallStack::~CallStack() {
42f33b8d2d07a057fdd667c2e0db629ba7cbc37cc3bryner  Clear();
43f33b8d2d07a057fdd667c2e0db629ba7cbc37cc3bryner}
44f33b8d2d07a057fdd667c2e0db629ba7cbc37cc3bryner
45f33b8d2d07a057fdd667c2e0db629ba7cbc37cc3brynervoid CallStack::Clear() {
46246f4068280b5b191303ff13671e43a0522987demmentovai  for (vector<StackFrame *>::const_iterator iterator = frames_.begin();
47246f4068280b5b191303ff13671e43a0522987demmentovai       iterator != frames_.end();
48246f4068280b5b191303ff13671e43a0522987demmentovai       ++iterator) {
49246f4068280b5b191303ff13671e43a0522987demmentovai    delete *iterator;
50246f4068280b5b191303ff13671e43a0522987demmentovai  }
51246f4068280b5b191303ff13671e43a0522987demmentovai}
52246f4068280b5b191303ff13671e43a0522987demmentovai
53e5dc60822e5938fea2ae892ccddb906641ba174emmentovai}  // namespace google_breakpad
54