Fix memory leaks
This commit is contained in:
@@ -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) {
|
||||
|
||||
{
|
||||
|
||||
@@ -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(); }
|
||||
|
||||
Reference in New Issue
Block a user