BareMetal: Fix crash on shutdown

Change-Id: I40c2381f5d70d57c8bb7b6d4727a5350a52eefc5
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Orgad Shaneh
2017-03-23 09:06:41 +02:00
committed by Orgad Shaneh
parent d31ba1a60e
commit 0c6d5d6aed
3 changed files with 8 additions and 1 deletions

View File

@@ -83,6 +83,12 @@ void BareMetalDevice::setGdbServerProviderId(const QString &id)
}
}
void BareMetalDevice::unregisterProvider(GdbServerProvider *provider)
{
if (provider->id() == m_gdbServerProviderId)
m_gdbServerProviderId.clear();
}
void BareMetalDevice::providerUpdated(GdbServerProvider *provider)
{
GdbServerProvider *myProvider = GdbServerProviderManager::findProvider(m_gdbServerProviderId);

View File

@@ -59,6 +59,7 @@ public:
QString gdbServerProviderId() const;
void setGdbServerProviderId(const QString &id);
void unregisterProvider(GdbServerProvider *provider);
void providerUpdated(GdbServerProvider *provider);
virtual void fromMap(const QVariantMap &map) override;

View File

@@ -78,7 +78,7 @@ GdbServerProvider::~GdbServerProvider()
{
const QSet<BareMetalDevice *> devices = m_devices;
for (BareMetalDevice *device : devices)
device->setGdbServerProviderId(QString());
device->unregisterProvider(this);
}
QString GdbServerProvider::displayName() const