mirror of
				https://github.com/hyperion-project/hyperion.ng.git
				synced 2025-03-01 10:33:28 +00:00 
			
		
		
		
	Fix some leaks (#863)
This commit is contained in:
		| @@ -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); | ||||
|   | ||||
| @@ -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)); | ||||
|   | ||||
| @@ -4,6 +4,11 @@ | ||||
|  | ||||
| using namespace commandline; | ||||
|  | ||||
| Parser::~Parser() | ||||
| { | ||||
| 	qDeleteAll(_options); | ||||
| } | ||||
|  | ||||
| bool Parser::parse(const QStringList &arguments) | ||||
| { | ||||
| 	if (!_parser.parse(arguments)) | ||||
|   | ||||
| @@ -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(); | ||||
|   | ||||
| @@ -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; | ||||
|   | ||||
| @@ -42,7 +42,7 @@ void LedDeviceFile::initFile(const QString &fileName) | ||||
| { | ||||
| 	if ( _file == nullptr ) | ||||
| 	{ | ||||
| 		_file = new QFile(fileName); | ||||
| 		_file = new QFile(fileName, this); | ||||
| 	} | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -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(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user