Commit 5af61d21 authored by Don Gagne's avatar Don Gagne

Correct ownership and deleteLater

parent 6f7ec666
......@@ -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