aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4arraybuffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4arraybuffer.cpp')
-rw-r--r--src/qml/jsruntime/qv4arraybuffer.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/qml/jsruntime/qv4arraybuffer.cpp b/src/qml/jsruntime/qv4arraybuffer.cpp
index a74e5c6299..b8b9971635 100644
--- a/src/qml/jsruntime/qv4arraybuffer.cpp
+++ b/src/qml/jsruntime/qv4arraybuffer.cpp
@@ -96,6 +96,12 @@ Heap::ArrayBuffer::ArrayBuffer(ExecutionEngine *e, int length)
memset(data->data(), 0, length + 1);
}
+Heap::ArrayBuffer::~ArrayBuffer()
+{
+ if (!data->ref.deref())
+ QTypedArrayData<char>::deallocate(data);
+}
+
QByteArray ArrayBuffer::asByteArray() const
{
QByteArrayDataPtr ba = { d()->data };
@@ -103,14 +109,6 @@ QByteArray ArrayBuffer::asByteArray() const
return QByteArray(ba);
}
-void ArrayBuffer::destroy(Managed *m)
-{
- ArrayBuffer *b = static_cast<ArrayBuffer *>(m);
- if (!b->d()->data->ref.deref())
- QTypedArrayData<char>::deallocate(b->d()->data);
-}
-
-
void ArrayBufferPrototype::init(ExecutionEngine *engine, Object *ctor)
{
Scope scope(engine);