X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=common%2Ftrace_model.cpp;h=3f19bc6c60b27c43f82f66acd976fdee364871dc;hb=62bce80269d08b94315ce5ca13ed0431137eeef9;hp=86527a1f900f59959691ca740656199c417b5280;hpb=112a1329ecceaca7386369a1cc685af44dd34738;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];