destroy grabbers and other stuff on hyperiond restart via webui (#375)

* remove obsolete kodi code for grabbers

* destroy grabbers and other stuff on hyperiond restart via webui
This commit is contained in:
redPanther
2017-01-22 14:31:11 +01:00
committed by GitHub
parent abc798a479
commit 3aa2573b88
7 changed files with 36 additions and 3 deletions

View File

@@ -1,11 +1,18 @@
SET(Hyperiond_QT_HEADERS
hyperiond.h
)
QT5_WRAP_CPP(Hyperiond_HEADERS_MOC ${Hyperiond_QT_HEADERS})
add_executable(hyperiond
${Hyperiond_QT_HEADERS}
${Hyperiond_HEADERS_MOC}
configMigratorBase.cpp
configMigratorBase.h
configMigrator.cpp
configMigrator.h
hyperiond.cpp
hyperiond.h
main.cpp
)

View File

@@ -79,6 +79,13 @@ HyperionDaemon::HyperionDaemon(QString configFile, QObject *parent)
HyperionDaemon::~HyperionDaemon()
{
freeObjects();
delete _hyperion;
}
void HyperionDaemon::freeObjects()
{
Debug(_log, "destroy grabbers and network stuff");
delete _amlGrabber;
delete _dispmanx;
delete _fbGrabber;
@@ -92,8 +99,17 @@ HyperionDaemon::~HyperionDaemon()
delete _protoServer;
delete _boblightServer;
delete _udpListener;
delete _hyperion;
_v4l2Grabbers.clear();
_amlGrabber = nullptr;
_dispmanx = nullptr;
_fbGrabber = nullptr;
_osxGrabber = nullptr;
_kodiVideoChecker = nullptr;
_jsonServer = nullptr;
_protoServer = nullptr;
_boblightServer = nullptr;
_udpListener = nullptr;
}
void HyperionDaemon::run()
@@ -113,7 +129,7 @@ void HyperionDaemon::run()
#endif
Info(_log, "Hyperion started");
connect(_hyperion,SIGNAL(closing()),this,SLOT(freeObjects()));
}
int HyperionDaemon::tryLoadConfig(const QString & configFile, const int schemaVersion)

View File

@@ -49,6 +49,7 @@
class HyperionDaemon : public QObject
{
Q_OBJECT
public:
HyperionDaemon(QString configFile, QObject *parent=nullptr);
~HyperionDaemon();
@@ -65,6 +66,9 @@ public:
void createGrabberV4L2();
void createSystemFrameGrabber();
public slots:
void freeObjects();
private:
void createGrabberDispmanx();
void createGrabberAmlogic();