Fix memory leaks
This commit is contained in:
@@ -399,8 +399,7 @@ void Playlist::SongSaveComplete(TagReaderReply *reply, const QPersistentModelInd
|
||||
emit Error(tr("An error occurred writing metadata to '%1'").arg(QString::fromStdString(reply->request_message().save_file_request().filename())));
|
||||
}
|
||||
}
|
||||
|
||||
metaObject()->invokeMethod(reply, "deleteLater", Qt::QueuedConnection);
|
||||
reply->deleteLater();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -395,12 +395,17 @@ TagCompleter::TagCompleter(CollectionBackend *backend, Playlist::Column column,
|
||||
|
||||
}
|
||||
|
||||
TagCompleter::~TagCompleter() {
|
||||
delete model();
|
||||
}
|
||||
|
||||
void TagCompleter::ModelReady(QFuture<TagCompletionModel*> future) {
|
||||
|
||||
TagCompletionModel *model = future.result();
|
||||
setModel(model);
|
||||
setCaseSensitivity(Qt::CaseInsensitive);
|
||||
editor_->setCompleter(this);
|
||||
|
||||
}
|
||||
|
||||
QWidget *TagCompletionItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem&, const QModelIndex&) const {
|
||||
@@ -409,6 +414,7 @@ QWidget *TagCompletionItemDelegate::createEditor(QWidget *parent, const QStyleOp
|
||||
new TagCompleter(backend_, column_, editor);
|
||||
|
||||
return editor;
|
||||
|
||||
}
|
||||
|
||||
QString NativeSeparatorsDelegate::displayText(const QVariant &value, const QLocale&) const {
|
||||
|
||||
@@ -144,6 +144,7 @@ class TagCompleter : public QCompleter {
|
||||
|
||||
public:
|
||||
TagCompleter(CollectionBackend *backend, Playlist::Column column, QLineEdit *editor);
|
||||
~TagCompleter();
|
||||
|
||||
private slots:
|
||||
void ModelReady(QFuture<TagCompletionModel*> future);
|
||||
|
||||
Reference in New Issue
Block a user