diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 06c2dd2446..82e8e5c37d 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -64,7 +64,7 @@ DomainServer::DomainServer(int argc, char* argv[]) : QString documentRootString = QString("%1/resources/web").arg(QCoreApplication::applicationDirPath()); - char documentRoot[documentRootString.size() + 1]; + char* documentRoot = new char[documentRootString.size() + 1]; strcpy(documentRoot, documentRootString.toLocal8Bit().constData()); // list of options. Last element must be NULL. @@ -105,6 +105,8 @@ DomainServer::DomainServer(int argc, char* argv[]) : QTimer::singleShot(RESTART_HOLD_TIME_MSECS, this, SLOT(addStaticAssignmentsBackToQueueAfterRestart())); connect(this, SIGNAL(aboutToQuit()), SLOT(cleanup())); + + delete[] documentRoot; } void DomainServer::readAvailableDatagrams() { diff --git a/libraries/audio/src/Sound.cpp b/libraries/audio/src/Sound.cpp index 5f233e2c63..a918907ab0 100644 --- a/libraries/audio/src/Sound.cpp +++ b/libraries/audio/src/Sound.cpp @@ -6,6 +6,8 @@ // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. // +#include + #include #include #include @@ -17,26 +19,26 @@ Sound::Sound(const QUrl& sampleURL, QObject* parent) : { // assume we have a QApplication or QCoreApplication instance and use the // QNetworkAccess manager to grab the raw audio file at the given URL - + QNetworkAccessManager *manager = new QNetworkAccessManager(this); connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*))); - + manager->get(QNetworkRequest(sampleURL)); } void Sound::replyFinished(QNetworkReply* reply) { // replace our byte array with the downloaded data QByteArray rawAudioByteArray = reply->readAll(); - + // assume that this was a RAW file and is now an array of samples that are // signed, 16-bit, 48Khz, mono - + // we want to convert it to the format that the audio-mixer wants // which is signed, 16-bit, 24Khz, mono - + _byteArray.resize(rawAudioByteArray.size() / 2); - + int numSourceSamples = rawAudioByteArray.size() / sizeof(int16_t); int16_t* sourceSamples = (int16_t*) rawAudioByteArray.data(); int16_t* destinationSamples = (int16_t*) _byteArray.data();