summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothtransferreply_bluez.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bluetooth/qbluetoothtransferreply_bluez.cpp')
-rw-r--r--src/bluetooth/qbluetoothtransferreply_bluez.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bluetooth/qbluetoothtransferreply_bluez.cpp b/src/bluetooth/qbluetoothtransferreply_bluez.cpp
index ae29ce37..f0806d5e 100644
--- a/src/bluetooth/qbluetoothtransferreply_bluez.cpp
+++ b/src/bluetooth/qbluetoothtransferreply_bluez.cpp
@@ -47,6 +47,7 @@
#include <QtCore/QAtomicInt>
#include <QtCore/QLoggingCategory>
+#include <QtCore/QVector>
#include <QFuture>
#include <QFutureWatcher>
#include <QtConcurrentRun>
@@ -160,16 +161,15 @@ bool QBluetoothTransferReplyBluez::start()
bool QBluetoothTransferReplyBluez::copyToTempFile(QIODevice *to, QIODevice *from)
{
- char *block = new char[4096];
+ QVector<char> block(4096);
int size;
- while ((size = from->read(block, 4096)) > 0) {
- if(size != to->write(block, size)){
+ while ((size = from->read(block.data(), block.size())) > 0) {
+ if (size != to->write(block.data(), size)) {
return false;
}
}
- delete[] block;
return true;
}