mirror of
https://github.com/KDE/kasts.git
synced 2025-01-30 17:15:03 +01:00
Fix segfault when removing feeds with currently playing entries
This commit is contained in:
parent
2eb1092f46
commit
21e9d0b9a7
@ -237,6 +237,8 @@ void AudioManager::setEntry(Entry *entry)
|
||||
DataManager::instance().setLastPlayingEntry(QStringLiteral("none"));
|
||||
d->m_entry = nullptr;
|
||||
Q_EMIT entryChanged(nullptr);
|
||||
d->m_player.stop();
|
||||
d->m_player.setMedia(nullptr);
|
||||
d->m_readyToPlay = false;
|
||||
Q_EMIT durationChanged(0);
|
||||
Q_EMIT positionChanged(0);
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "database.h"
|
||||
#include "fetcher.h"
|
||||
#include "settingsmanager.h"
|
||||
#include "audiomanager.h"
|
||||
#include <QDateTime>
|
||||
#include <QDir>
|
||||
#include <QSqlDatabase>
|
||||
@ -252,6 +253,9 @@ void DataManager::removeFeed(const int index)
|
||||
qDebug() << "delete queueentries of" << feedurl;
|
||||
for (auto &id : m_queuemap) {
|
||||
if (getEntry(id)->feed()->url() == feedurl) {
|
||||
if(AudioManager::instance().entry() == getEntry(id)) {
|
||||
AudioManager::instance().next();
|
||||
}
|
||||
removeQueueItem(id);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user