Fix memory leaks

This commit is contained in:
Jonas Kvinge
2019-07-22 20:53:05 +02:00
parent 2df21081a1
commit bd78e8c275
33 changed files with 186 additions and 74 deletions

View File

@@ -32,6 +32,14 @@
LyricsProviders::LyricsProviders(QObject *parent) : QObject(parent) {}
LyricsProviders::~LyricsProviders() {
while (!lyrics_providers_.isEmpty()) {
delete lyrics_providers_.firstKey();
}
}
void LyricsProviders::AddProvider(LyricsProvider *provider) {
{

View File

@@ -39,6 +39,8 @@ class LyricsProviders : public QObject {
public:
explicit LyricsProviders(QObject *parent = nullptr);
~LyricsProviders();
void AddProvider(LyricsProvider *provider);
void RemoveProvider(LyricsProvider *provider);
QList<LyricsProvider*> List() const { return lyrics_providers_.keys(); }