Skip to content

Commit

Permalink
Fix not disconnecting
Browse files Browse the repository at this point in the history
  • Loading branch information
kraxarn committed Apr 12, 2020
1 parent 64b9c53 commit 51440a6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/spotify/spotify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,9 @@ QVector<Album> Spotify::newReleases()

void Spotify::requestCurrentPlayback()
{
QMetaObject::Connection connection;
connection = Spotify::connect(this, &Spotify::got, [this, connection](const QJsonDocument &json){
Spotify::disconnect(connection);
auto context = new QObject(this);
Spotify::connect(this, &Spotify::got, context, [this, context](const QJsonDocument &json) {
delete context;
emit gotPlayback(Playback(json.object()));
});
getLater("me/player");
Expand Down

0 comments on commit 51440a6

Please sign in to comment.