Skip to content
Snippets Groups Projects
Commit 0c6d5d6a authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

BareMetal: Fix crash on shutdown


Change-Id: I40c2381f5d70d57c8bb7b6d4727a5350a52eefc5
Reviewed-by: default avatarDenis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: default avatarhjk <hjk@qt.io>
parent d31ba1a6
No related branches found
No related tags found
No related merge requests found
...@@ -83,6 +83,12 @@ void BareMetalDevice::setGdbServerProviderId(const QString &id) ...@@ -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) void BareMetalDevice::providerUpdated(GdbServerProvider *provider)
{ {
GdbServerProvider *myProvider = GdbServerProviderManager::findProvider(m_gdbServerProviderId); GdbServerProvider *myProvider = GdbServerProviderManager::findProvider(m_gdbServerProviderId);
......
...@@ -59,6 +59,7 @@ public: ...@@ -59,6 +59,7 @@ public:
QString gdbServerProviderId() const; QString gdbServerProviderId() const;
void setGdbServerProviderId(const QString &id); void setGdbServerProviderId(const QString &id);
void unregisterProvider(GdbServerProvider *provider);
void providerUpdated(GdbServerProvider *provider); void providerUpdated(GdbServerProvider *provider);
virtual void fromMap(const QVariantMap &map) override; virtual void fromMap(const QVariantMap &map) override;
......
...@@ -78,7 +78,7 @@ GdbServerProvider::~GdbServerProvider() ...@@ -78,7 +78,7 @@ GdbServerProvider::~GdbServerProvider()
{ {
const QSet<BareMetalDevice *> devices = m_devices; const QSet<BareMetalDevice *> devices = m_devices;
for (BareMetalDevice *device : devices) for (BareMetalDevice *device : devices)
device->setGdbServerProviderId(QString()); device->unregisterProvider(this);
} }
QString GdbServerProvider::displayName() const QString GdbServerProvider::displayName() const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment