Commit 61202e9a authored by Don Gagne's avatar Don Gagne

Change toolbox startup mechanism

This prevents problems with toolbox references from inside
QGCTool::setToolbox calls.
parent eca72e33
......@@ -343,6 +343,7 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
initializeVideoStreaming(argc, argv);
_toolbox = new QGCToolbox(this);
_toolbox->setChildToolboxes();
}
QGCApplication::~QGCApplication()
......
......@@ -71,7 +71,10 @@ QGCToolbox::QGCToolbox(QGCApplication* app)
_qgcPositionManager = new QGCPositionManager(app);
_followMe = new FollowMe(app);
_videoManager = new VideoManager(app);
}
void QGCToolbox::setChildToolboxes(void)
{
_audioOutput->setToolbox(this);
_autopilotPluginManager->setToolbox(this);
_factSystem->setToolbox(this);
......
......@@ -61,6 +61,8 @@ public:
#endif
private:
void setChildToolboxes(void);
GAudioOutput* _audioOutput;
AutoPilotPluginManager* _autopilotPluginManager;
FactSystem* _factSystem;
......@@ -81,6 +83,8 @@ private:
FollowMe* _followMe;
QGCPositionManager* _qgcPositionManager;
VideoManager* _videoManager;
friend class QGCApplication;
};
/// This is the base class for all tools
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment