fix crash in shutdown

This commit is contained in:
Michael Zanetti 2017-12-22 11:26:28 +01:00
parent b2db373c34
commit 9716d1db7b
3 changed files with 11 additions and 1 deletions

View File

@ -121,13 +121,17 @@ GuhCore *GuhCore::instance()
GuhCore::~GuhCore() GuhCore::~GuhCore()
{ {
m_logger->logSystemEvent(m_timeManager->currentDateTime(), false); m_logger->logSystemEvent(m_timeManager->currentDateTime(), false);
// Make sure DeviceManager is teared down at first so plugins don't access any ressources any more.
delete m_deviceManager;
} }
/*! Destroyes the \l{GuhCore} instance. */ /*! Destroyes the \l{GuhCore} instance. */
void GuhCore::destroy() void GuhCore::destroy()
{ {
if (s_instance) if (s_instance) {
delete s_instance; delete s_instance;
}
s_instance = 0; s_instance = 0;
} }

View File

@ -84,6 +84,11 @@ HardwareManagerImplementation::HardwareManagerImplementation(QObject *parent) :
qCDebug(dcHardware()) << "HardwareManager D-Bus service set up."; qCDebug(dcHardware()) << "HardwareManager D-Bus service set up.";
} }
HardwareManagerImplementation::~HardwareManagerImplementation()
{
qCDebug(dcApplication()) << "Shutting down Hardware Manager";
}
Radio433 *HardwareManagerImplementation::radio433() Radio433 *HardwareManagerImplementation::radio433()
{ {
return m_radio433; return m_radio433;

View File

@ -49,6 +49,7 @@ class HardwareManagerImplementation : public HardwareManager
public: public:
explicit HardwareManagerImplementation(QObject *parent = nullptr); explicit HardwareManagerImplementation(QObject *parent = nullptr);
~HardwareManagerImplementation();
Radio433 *radio433(); Radio433 *radio433();
PluginTimerManager *pluginTimerManager(); PluginTimerManager *pluginTimerManager();