Commit e35cf4c8 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #3744 from DonLakeFlyer/LogDownload

Log download: Correct ownership and deleteLater
parents 0fefa4fb 5af61d21
......@@ -675,6 +675,7 @@ void
QGCLogModel::append(QGCLogEntry* object)
{
beginInsertRows(QModelIndex(), rowCount(), rowCount());
QQmlEngine::setObjectOwnership(object, QQmlEngine::CppOwnership);
_logEntries.append(object);
endInsertRows();
emit countChanged();
......@@ -688,7 +689,7 @@ QGCLogModel::clear(void)
beginRemoveRows(QModelIndex(), 0, _logEntries.count());
while (_logEntries.count()) {
QGCLogEntry* entry = _logEntries.last();
if(entry) delete entry;
if(entry) entry->deleteLater();
_logEntries.removeLast();
}
endRemoveRows();
......
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