mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-17 02:52:12 +01:00
OP-99 Export-Import-Plugin: Fix crashes on import.
Before the UAVGadgetView is deleted, the gadget (GadgetDecorator) must always be removed, otherwise the widgets (toolbar) will be automatically deleted but this might cause a crash since the gadget is managed by the GadgetInstanceManager. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1446 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
511a9c6635
commit
e0a939819a
@ -92,8 +92,10 @@ void ModeManager::addWidget(QWidget *widget)
|
||||
|
||||
IMode *ModeManager::currentMode() const
|
||||
{
|
||||
if (m_modes.count() > 0)
|
||||
if (m_modes.count() > m_modeStack->currentIndex() )
|
||||
return m_modes.at(m_modeStack->currentIndex());
|
||||
else
|
||||
m_modeStack->setCurrentIndex(0); // Fix illegal Index.
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -152,6 +152,7 @@ UAVGadgetView::UAVGadgetView(Core::UAVGadgetManager *uavGadgetManager, IUAVGadge
|
||||
|
||||
UAVGadgetView::~UAVGadgetView()
|
||||
{
|
||||
removeGadget();
|
||||
}
|
||||
|
||||
bool UAVGadgetView::hasGadget(IUAVGadget *uavGadget) const
|
||||
|
Loading…
x
Reference in New Issue
Block a user