Browse Source

Merge pull request #3744 from DonLakeFlyer/LogDownload

Log download: Correct ownership and deleteLater
QGC4.4
Don Gagne 9 years ago committed by GitHub
parent
commit
e35cf4c84b
  1. 3
      src/ViewWidgets/LogDownloadController.cc

3
src/ViewWidgets/LogDownloadController.cc

@ -675,6 +675,7 @@ void @@ -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) @@ -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();

Loading…
Cancel
Save