Application: Use shared pointers

Fixes #1239
This commit is contained in:
Jonas Kvinge
2023-07-21 05:55:24 +02:00
parent d6b53f78ab
commit 2e61235403
316 changed files with 2170 additions and 1643 deletions

View File

@@ -29,11 +29,14 @@
#include <QFile>
#include "core/logging.h"
#include "core/scoped_ptr.h"
#include "fileutils.h"
namespace Utilities {
using std::unique_ptr;
QByteArray ReadDataFromFile(const QString &filename) {
QFile file(filename);
@@ -56,7 +59,7 @@ bool Copy(QIODevice *source, QIODevice *destination) {
if (!destination->open(QIODevice::WriteOnly)) return false;
const qint64 bytes = source->size();
std::unique_ptr<char[]> data(new char[bytes]);
unique_ptr<char[]> data(new char[bytes]);
qint64 pos = 0;
qint64 bytes_read = 0;