summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZack Rusin <zack@kde.org>2011-09-27 12:04:10 -0400
committerZack Rusin <zack@kde.org>2011-09-27 12:05:34 -0400
commit9523768fe89d08e8e21922a973e0f8424459e9b9 (patch)
tree4a36159c910dd48429e57ef98ab818ab096c82ac
parent289dc2f377af1d8bc95a94b390b682b15e560bff (diff)
Deep copy the blob data.
Fixes a memory leak.
-rw-r--r--gui/apitracecall.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/gui/apitracecall.cpp b/gui/apitracecall.cpp
index 8074762..f500d90 100644
--- a/gui/apitracecall.cpp
+++ b/gui/apitracecall.cpp
@@ -208,16 +208,7 @@ void VariantVisitor::visit(Trace::Array *array)
void VariantVisitor::visit(Trace::Blob *blob)
{
- //XXX
- //FIXME: this is a nasty hack. Trace::Blob's can't
- // delete the contents in the destructor because
- // the data is being used by other calls. We piggy back
- // on that assumption and don't deep copy the data. If
- // Blob's will start deleting the data we will need to
- // start deep copying it or switch to using something like
- // Boost's shared_ptr or Qt's QSharedPointer to handle it
- blob->toPointer(true);
- QByteArray barray = QByteArray::fromRawData(blob->buf, blob->size);
+ QByteArray barray = QByteArray(blob->buf, blob->size);
m_variant = QVariant(barray);
}