Commit 6577e48a authored by Jessica's avatar Jessica

Memory leaks fixed in unit tests.

parent 8564aa00
......@@ -53,9 +53,8 @@ QGCFlightGearLink::QGCFlightGearLink(UASInterface* mav, QString remoteHost, QHos
}
QGCFlightGearLink::~QGCFlightGearLink()
{ //if it is connected, then process, terraSync and socket were allocated memory
//if they were not connected, then they were never allocated, so no need to free memory or
//to disconnect the simulation
{ //do not disconnect unless it is connected.
//disconnectSimulation will delete the memory that was allocated for proces, terraSync and socket
if(connectState){
disconnectSimulation();
}
......
......@@ -195,6 +195,7 @@ void UASUnitTest::setAirframe_test()
uas->setAirframe(12);
QVERIFY(uas->getAirframe() == 11);
}
void UASUnitTest::getWaypointList_test()
{
QVector<Waypoint*> kk = uas->getWaypointManager()->getWaypointEditableList();
......@@ -286,11 +287,6 @@ void UASUnitTest::signalWayPoint_test()
delete wp2;
}
//TODO:startHil. to make sure connect and disconnect simulation in QGCFlightGear works properly
//TODO:stopHil
void UASUnitTest::signalUASLink_test()
{
......
......@@ -121,16 +121,9 @@ UAS::~UAS()
{
writeSettings();
delete links;
if(statusTimeout->isActive())
{
statusTimeout->deleteLater();
}
delete statusTimeout;
delete simulation;
mavlink->deleteLater();
delete paramManager;
}
void UAS::writeSettings()
{
......
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