X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=common%2Ftrace_model.cpp;h=3f19bc6c60b27c43f82f66acd976fdee364871dc;hb=66ce10aed5cd8c4b1df5b53645b92ee81b16d8e2;hp=86527a1f900f59959691ca740656199c417b5280;hpb=e7cb2b98575d5ff3801bd3527a648e0dbfdebdad;p=apitrace diff --git a/common/trace_model.cpp b/common/trace_model.cpp index 86527a1..3f19bc6 100644 --- a/common/trace_model.cpp +++ b/common/trace_model.cpp @@ -72,6 +72,18 @@ Blob::~Blob() { } } +StackFrame::~StackFrame() { + if (module != NULL) { + delete [] module; + } + if (function != NULL) { + delete [] function; + } + if (filename != NULL) { + delete [] filename; + } +} + // bool cast bool Null ::toBool(void) const { return false; } @@ -191,12 +203,14 @@ void Visitor::visit(Array *) { assert(0); } void Visitor::visit(Blob *) { assert(0); } void Visitor::visit(Pointer *) { assert(0); } void Visitor::visit(Repr *node) { node->machineValue->visit(*this); } +void Visitor::visit(Backtrace *) { assert(0); } +void Visitor::visit(StackFrame *) { assert(0); } static Null null; const Value & Value::operator[](size_t index) const { - const Array *array = dynamic_cast(this); + const Array *array = toArray(); if (array) { if (index < array->values.size()) { return *array->values[index];