diff --git a/include/commandline/Parser.h b/include/commandline/Parser.h index 3c2c7848..129d5184 100644 --- a/include/commandline/Parser.h +++ b/include/commandline/Parser.h @@ -28,6 +28,8 @@ protected: QString _getDescription(const QString description, const QString default_=QString()); public: + ~Parser() override; + bool parse(const QStringList &arguments); void process(const QStringList &arguments); void process(const QCoreApplication &app); diff --git a/include/utils/Image.h b/include/utils/Image.h index 73ead228..b500a2bb 100644 --- a/include/utils/Image.h +++ b/include/utils/Image.h @@ -256,6 +256,7 @@ public: { _width = 1; _height = 1; + delete[] _pixels; _pixels = new Pixel_T[2]; _endOfPixels = _pixels + 1; memset(_pixels, 0, (unsigned long) _width * _height * sizeof(Pixel_T)); diff --git a/libsrc/commandline/Parser.cpp b/libsrc/commandline/Parser.cpp index 71a62d63..84efea45 100644 --- a/libsrc/commandline/Parser.cpp +++ b/libsrc/commandline/Parser.cpp @@ -4,6 +4,11 @@ using namespace commandline; +Parser::~Parser() +{ + qDeleteAll(_options); +} + bool Parser::parse(const QStringList &arguments) { if (!_parser.parse(arguments)) diff --git a/libsrc/hyperion/HyperionIManager.cpp b/libsrc/hyperion/HyperionIManager.cpp index 65849643..d22424be 100644 --- a/libsrc/hyperion/HyperionIManager.cpp +++ b/libsrc/hyperion/HyperionIManager.cpp @@ -194,6 +194,7 @@ void HyperionIManager::handleFinished() Info(_log,"Hyperion instance '%s' has been stopped", QSTRING_CSTR(_instanceTable->getNamebyIndex(instance))); _runningInstances.remove(instance); + hyperion->thread()->deleteLater(); hyperion->deleteLater(); emit instanceStateChanged(InstanceState::H_STOPPED, instance); emit change(); diff --git a/libsrc/hyperion/PriorityMuxer.cpp b/libsrc/hyperion/PriorityMuxer.cpp index b04187ac..2c7b13c4 100644 --- a/libsrc/hyperion/PriorityMuxer.cpp +++ b/libsrc/hyperion/PriorityMuxer.cpp @@ -22,9 +22,9 @@ PriorityMuxer::PriorityMuxer(int ledCount) , _activeInputs() , _lowestPriorityInfo() , _sourceAutoSelectEnabled(true) - , _updateTimer(new QTimer()) - , _timer(new QTimer()) - , _blockTimer(new QTimer()) + , _updateTimer(new QTimer(this)) + , _timer(new QTimer(this)) + , _blockTimer(new QTimer(this)) { // init lowest priority info _lowestPriorityInfo.priority = PriorityMuxer::LOWEST_PRIORITY; diff --git a/libsrc/leddevice/dev_other/LedDeviceFile.cpp b/libsrc/leddevice/dev_other/LedDeviceFile.cpp index ab47a879..0cbc7735 100644 --- a/libsrc/leddevice/dev_other/LedDeviceFile.cpp +++ b/libsrc/leddevice/dev_other/LedDeviceFile.cpp @@ -42,7 +42,7 @@ void LedDeviceFile::initFile(const QString &fileName) { if ( _file == nullptr ) { - _file = new QFile(fileName); + _file = new QFile(fileName, this); } } diff --git a/src/hyperiond/hyperiond.cpp b/src/hyperiond/hyperiond.cpp index 97436368..770e1804 100644 --- a/src/hyperiond/hyperiond.cpp +++ b/src/hyperiond/hyperiond.cpp @@ -170,29 +170,29 @@ void HyperionDaemon::freeObjects() delete _jsonServer; _flatBufferServer->thread()->quit(); _flatBufferServer->thread()->wait(1000); - _flatBufferServer->deleteLater(); - _flatBufferServer->thread()->deleteLater(); + delete _flatBufferServer->thread(); + delete _flatBufferServer; _protoServer->thread()->quit(); _protoServer->thread()->wait(1000); - _protoServer->deleteLater(); - _protoServer->thread()->deleteLater(); + delete _protoServer->thread(); + delete _protoServer; //ssdp before webserver _ssdp->thread()->quit(); _ssdp->thread()->wait(1000); - _ssdp->deleteLater(); - _ssdp->thread()->deleteLater(); + delete _ssdp->thread(); + delete _ssdp; _webserver->thread()->quit(); _webserver->thread()->wait(1000); - _webserver->deleteLater(); - _webserver->thread()->deleteLater(); + delete _webserver->thread(); + delete _webserver; _sslWebserver->thread()->quit(); _sslWebserver->thread()->wait(1000); - _sslWebserver->deleteLater(); - _sslWebserver->thread()->deleteLater(); + delete _sslWebserver->thread(); + delete _sslWebserver; // stop Hyperions (non blocking) _instanceManager->stopAll();