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